Drag and Drop Row Reordering issue

Drag and Drop Row Reordering issue

rajarajananisrajarajananis Posts: 29Questions: 0Answers: 0
edited January 2014 in Plug-ins
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

Replies

  • allanallan Posts: 61,627Questions: 1Answers: 10,091 Site admin
    Hi Raja,

    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
  • rajarajananisrajarajananis Posts: 29Questions: 0Answers: 0
    Allan!!

    Good to see your suggestion. The issue I reported has been fixed now.

    Thanks a lot.
  • Pratik21Pratik21 Posts: 3Questions: 0Answers: 0
    Hey, Can you tell me how this issue got fixed?

    Thanks,
    Pratik
  • rajarajananisrajarajananis Posts: 29Questions: 0Answers: 0
    edited February 2014
    sure, It's my pleasure

    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
  • Pratik21Pratik21 Posts: 3Questions: 0Answers: 0
    Oh got it, thanks.
    I gave a row id to my rows and its working perfectly :)
  • rajarajananisrajarajananis Posts: 29Questions: 0Answers: 0
    Great. Nice to know it is working there.
This discussion has been closed.