jeditable facepalming.
jeditable facepalming.
I'm getting stuck on an issue with jeditable. This isn't datatable's fault or a bug, but I still hope someone here might have some pointers. The documentation for jeditable is deplorable and I can't find any useful info for their API, in particular for creating custom "types", except for this incredibly vague page: http://www.appelsiini.net/2007/8/custom-input-types
What I'm working on is a "properties panel", in a visual developer style, that will be used for a DataTables wizard to help people rapidly set up DT projects. You can see the panel at http://www.beg.utexas.edu/_work/dt/propertieswindow.htm . This page works pretty fine with one small issue that I'm trying to address: when a user double clicks on a "value", a text is good for singleton types like numbers and strings, but for arrays, objects, and functions, I want to use a .
This brought me to the idea of setting up a custom type in jeditable, because I can intercept the cell being edited and check the type (defined in a hidden column in the table) and give the correct or . The problem I have, and maybe there's a simple explanation and fix, is that 1) after submitting (I just use a simple echo.php) the value is echoed to the user in an annoying alert() box and 2) the value of my cell is not changed at all. You can see this on http://www.beg.utexas.edu/_work/dt/propertieswindow2.htm .
I thought to try using a function instead of the echo.php page, and I can then get the system to stop with the annoying alert() and it also updates the field, but now there's an issue with DataTables. DataTables kicks off the fnRender, but the data value for that row and column is "undefined", which causes a javascript error, and the render function does not work. This is odd because using console.log shows that editable has created a nice cell that it will put back into the DOM, but I guess it hasn't gotten around it yet when fnRender is run. You can see this at http://www.beg.utexas.edu/_work/dt/propertieswindow3.htm
So.. any advice?
What I'm working on is a "properties panel", in a visual developer style, that will be used for a DataTables wizard to help people rapidly set up DT projects. You can see the panel at http://www.beg.utexas.edu/_work/dt/propertieswindow.htm . This page works pretty fine with one small issue that I'm trying to address: when a user double clicks on a "value", a text is good for singleton types like numbers and strings, but for arrays, objects, and functions, I want to use a .
This brought me to the idea of setting up a custom type in jeditable, because I can intercept the cell being edited and check the type (defined in a hidden column in the table) and give the correct or . The problem I have, and maybe there's a simple explanation and fix, is that 1) after submitting (I just use a simple echo.php) the value is echoed to the user in an annoying alert() box and 2) the value of my cell is not changed at all. You can see this on http://www.beg.utexas.edu/_work/dt/propertieswindow2.htm .
I thought to try using a function instead of the echo.php page, and I can then get the system to stop with the annoying alert() and it also updates the field, but now there's an issue with DataTables. DataTables kicks off the fnRender, but the data value for that row and column is "undefined", which causes a javascript error, and the render function does not work. This is odd because using console.log shows that editable has created a nice cell that it will put back into the DOM, but I guess it hasn't gotten around it yet when fnRender is run. You can see this at http://www.beg.utexas.edu/_work/dt/propertieswindow3.htm
So.. any advice?
This discussion has been closed.
Replies
This page looks like it might contain a possible answer for a custom control for jEditable with textareas: http://www.appelsiini.net/2008/4/autogrow-textarea-for-jeditable . You could just pull out the auto grow code from it and hopefully that will work. Not tested it yet (must fly to work...) but I can have a look later if that is of any help.
Regards,
Allan
I imagine it will be offered as a zip file that one can run on their own site to generate their DataTables, or perhaps I'll put it up on a site that generates a custom package based on settings input by end-users. The one issue with having end-users run it on a remote site is that for DB related tables they would either have to manually enter all the data they want or they'd have to input a password into the system and trust that the owner of that site (me?) would not abuse that password.
I had seen the autogrow page, and used those patterns; that's what led me to getting those issues where the results of the editable actions are not making it to the page, or are getting "undefined" values in DataTables for that element in the data array. I'll dig through the editable plug-in code to get a better understanding of the flow of things in the integration.