I think this is a reasonable ask, but AFAIK it will also require new development. There are some in-light PRs that might make supporting this much easier, though. So, can you make a GH feature request issue to discuss fine-grained change notifications for data tables?
In the mean team I think you would need to make a custom extension of some sort (either of the cell editor, or possibly of data table itself) to support specifying a js callback for fine grained changes:
ok, i guess this is not the right way to go: the string length can be limited on the js side acting on the columndatasource cds
self.cds.js_on_change('change:data', js_callback)
but still, this is not efficient as we have to scan the entirety of the cds for each change of a single row and single column.
if anybody knows a more efficient solution to truncate a user entry in a datatable, let us know
thx
On Wednesday, March 1, 2017 at 2:38:22 PM UTC+1, chupach wrote:
Hello,
I want to limit the number of characters allowed in a datatable column on the js side to prevent a user entering a too large amount of them.
Given a datatable with a tableColumn editor=ed where ed=StringEditor(),
and
ed.js_on_change('data',ed_callback) # i tried also with 'value'
where
ed_callback = CustomJS(code="""console.log('string changed');""")
While the server runs without error, the js callback is not called.