Drag and Drop Row Reordering issue
Drag and Drop Row Reordering issue
rajarajananis
Posts: 29Questions: 0Answers: 0
Hello DataTable team, How are you
I am utilizing this plug-in for many days. Great. And, here is my new question
I try to add a row re-order drag& and drop in data table, In my case data comes from Ajax call with json format.
For drag and drop row reorder I use the following plugin associated with datatable plugin
http://jquery-datatables-row-reordering.googlecode.com/svn/trunk/index.html
but I get this error when I debug in firefox
Error: Syntax error, unrecognized expression: #
... function bi(a, b, d) { var e = b.dir, f = d && b.dir === "parentNode", g = u++;...
can you help me to come across this issue?
Thanks
Raja.S
I am utilizing this plug-in for many days. Great. And, here is my new question
I try to add a row re-order drag& and drop in data table, In my case data comes from Ajax call with json format.
For drag and drop row reorder I use the following plugin associated with datatable plugin
http://jquery-datatables-row-reordering.googlecode.com/svn/trunk/index.html
but I get this error when I debug in firefox
Error: Syntax error, unrecognized expression: #
... function bi(a, b, d) { var e = b.dir, f = d && b.dir === "parentNode", g = u++;...
can you help me to come across this issue?
Thanks
Raja.S
This discussion has been closed.
Replies
That plug-in you linked to is third party and not supported as part of the DataTables project. I'd suggest opening an issue on that project's issue tracker: http://code.google.com/p/jquery-datatables-row-reordering/issues/list .
Allan
Good to see your suggestion. The issue I reported has been fixed now.
Thanks a lot.
Thanks,
Pratik
The plug-in RowReorder needs data table initialized with unique Row ID. so, while we initialize the data table please use[quote] fnRowCallback[/quote] param in order to apply row id for each and every row. That's all . Fixed. Please let me know if you need more information on this. Refer the code below.
[code]
var oTable= $("#myHTMLTable").dataTable({
"aaData": data, //json data
"bDestroy": true,
"bProcessing": true,
"oLanguage": {
"sEmptyTable": "No Data"
},
"fnRowCallback": function (nRow, aData, iDisplayIndex) {
nRow.setAttribute('id', aData.RowOrder); //Initialize row id for every row
},
"sPaginationType": "full_numbers",
"aoColumns": [
{ "mData": "RowOrder", "bVisible": false }, //row order which added as a row id. make it //visible true as needed
{ "mData": "ClaimTemplateFieldTitle", "sTitle": "Question Text", "sWidth": "250", "bSortable": false },
{ "mData": "FieldTypeTitle", "sTitle": "Type", "sWidth": "70", "bSortable": false
},
{ "mData": "ClaimTemplateFieldID", "bVisible": false },
{ "mData": "FieldTypeID", "bVisible": false },
{ "mData": "DefaultValue", "bVisible": false }
]
});
oTable.rowReordering({
sURL: "HttpHandler/Mytesthandler.ashx",
sRequestType: "GET"
});
[/code]
Thanks
Raja.S
I gave a row id to my rows and its working perfectly :)