Getting "TypeError: this.c.editor.edit is not a function" error
Getting "TypeError: this.c.editor.edit is not a function" error
I am using DataTables(1.10.11) w/ Editor(1.5.5 trial) and the RowReorder (1.1.1)
When I reorder (drag and drop) a row, the row is reordering correctly but in firebug I am seeing an error stating that "TypeError: this.c.editor.edit is not a function" the reordering is done server-side and does "take" but since the error occurs no further reordering can be done without a page refresh.
Any ideas what "TypeError: this.c.editor.edit is not a function" might refer to?
This question has an accepted answers - jump to answer
Answers
I think this suggests that the value passed to
rowReorder.editor
is not an Editor instance. Could you give me a link to the page or show me your code please?Allan
I have a test page visible at http://fhp.longthoughtsolutions.com/phoneTest.htm you could look at. It isn't full functional as the "real" page is behind a login. If you need a login I can create one but take a look and see if the test tells you what you need to know. Thanks in advance for your help
Thanks! You have:
i.e - passing in a string not an Editor instance. Try simply:
Allan
Crap I feel stupid. Thanks
I am getting a different error now.
TypeError: fields[fieldNames] is undefined
This would appear to be related to error trapping based on what I read in the docs but there is no error being thrown
You need to use
rowReorder.dataSrc
to tell it what data element in the source object it should modify for the reorder (i.e. the sequence number typically). There is an example available here.Allan
Hi Allan,
I did purchase Editor as it is very helpful and useful.
I have added the rowReorder.dataSrc as you suggested but it is now only passing that specific value. I there a way to have it pass the data from the entire row?
I have set it up like this
rowReorder: {
editor: editor_52124,
selector: 'td:last-child',
update: false,
dataSrc: 'sortBy'
}
Now the only bit of information that is getting passed is :
action edit
data[2][sortBy] = 3
data[3][sortBy] = 2
data[5][sortBy] = 4
data[7][sortBy] = 1
This is the post from one drag and drop. I am not even sure what this data is. Previously , and i might have been using a wrong plug-in or version, I was getting a .oldPosition and a .newPosition and was able to pass additional data like (in this case) a phoneTypeID (In other places I may need to pass additional information like group if an item is sorted within a group)
How can I get the data from more than just one data point? Thanks in advance for your help
Yes. RowReorder uses Editor's
bubble()
method to trigger the edit, and by default it will submit only the data that has been changed for each row. To have it submit the full data you can set the default usingformOptions.bubble
(use thesubmit
option, which is documented in theform-options
documentation).Regards,
Allan
Thanks for the great support!!