I notice that in my datatable if one cell under a particular column is getting the value from template function, then if I edit and put some text, it disappears.
Again, when I click on the cell, I see the edited value , otherwise it just shows the earlier value only.
What is the solution for this to display the newly typed value?
There is a small problem. Let’s say if I want to edit the existing value ‘dummy name’ to ‘dummy name bla bla bla’ , then also the moment I click on the cell the existing value is disappearing. Then how will I know at the time of editing that which value I am changing ?
This is not happening if I just use a normal editable cell without the template function.
In your snippet you have hard coded the value as ‘dummy name’ in scheme:$init. Let’s say if the default value I am getting from the ‘obj’ parameter of my show_values function, in that case how can I set that in $init ?
I have changed my snippet a bit as both columns under ‘Place’ is now editable and the cells under them have values both from obj and hardcoded together.
So just consider I always get the values from ‘obj’ of show_values tmeplate function, how can I achieve that as default value in $init while first loading the table?
I am facing a weird problem which I am explaining step by step:
Let’s say id5 in one of the cells initially contains “good” (fetched from the database).
I click on it, change ‘good’ to ‘good morning’. Remove control from the cell and it now shows ‘good morning’ as expected.
I save that data from the datatable into the database. (This I can not show here).
Next time I load the page and id5 again contains “good” only whereas I expect to see ‘good morning’ as it got saved properly in step #3.
Is this possible ? Because the ‘row’ object in $init should every time fetch the
newest value on page load.
As per my understanding of the doc, the $init works on loading and also while reloading the data for new Datastore. Please correct me if I have misunderstood anything.