Edit mode record moving to end of the list

Edit mode record moving to end of the list

vijaykumarvemulavijaykumarvemula Posts: 7Questions: 4Answers: 0

I am using jquery datatable in vf page. I have one issue. when i trying to edit the record, that record automatically going end of the list. Is there a way to stay on the same row.

var contactTable = j$('[id$="safetyContractTables"]').DataTable({ "bPaginate":true, "bsort":true, "bstateSave": true, });

I want to stay on the same row.

Answers

  • allanallan Posts: 63,799Questions: 1Answers: 10,514 Site admin

    The row's new position will be determined entirely by the sorting applied to the table and the data in the row. For example if you change the data being sorted from a to z, then yes, it would drop to the end of the table.

    If you don't want DataTables to do an automatic resort, use the drawType option of the form-options object and set it to be none.

    Allan

  • vijaykumarvemulavijaykumarvemula Posts: 7Questions: 4Answers: 0
    edited June 2016

    Hi Allan, I tried like below but it not working. can you help is it correct or not, if not how to correct it.
    j$ = jQuery.noConflict();
    var contactTable = j$('[id$="safetyContractTables"]').DataTable({

                    "bPaginate":true,
                    "bsort":true,
                    "bstateSave": true,
                });
                $('#safetyContractTables').on( 'click', 'tbody td', function () {
                    editor.inline( this, {
                        drawType: 'page'
                    } );
                } );
    
  • allanallan Posts: 63,799Questions: 1Answers: 10,514 Site admin

    You need to use the value none as I mentioned above. page will still resort the table.

    Allan

  • vijaykumarvemulavijaykumarvemula Posts: 7Questions: 4Answers: 0

    Yes allan, here typed wrongly i tried with none also. I am editing record manually, i am not using inline editor. may be this can be effected..?

  • allanallan Posts: 63,799Questions: 1Answers: 10,514 Site admin

    I am editing record manually, i am not using inline editor.

    I had assumed you were using inline editing from the use of inline() above - but is this in fact being triggered by something else? What does you mean by "manually"? Are you using the DataTables or Editor APIs? Writing to the DOM, something else?

    Allan

  • vijaykumarvemulavijaykumarvemula Posts: 7Questions: 4Answers: 0

    Wrote custom logic for editing.

  • allanallan Posts: 63,799Questions: 1Answers: 10,514 Site admin

    Does it conform to the client / server interchange required by Editor? Can you show me?

    Allan

This discussion has been closed.