jQuery UI Widgets Forums Grid column editing and sorting

This topic contains 1 reply, has 2 voices, and was last updated by  Dimitar 12 years, 1 month ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • column editing and sorting #6793

    cherry
    Member

    Is there a way to disable sortable or eiditable feature of some columns while other columns remain enabled?

    column editing and sorting #6794

    Dimitar
    Participant

    Hello cherry,

    Yes, there is a simple way of disabling the sortable or editable feature of a column. Here is a code excerpt which does that (the first column is neither sortable nor editable, all the others are):

    $("#jqxgrid").jqxGrid(
    {
    source: source,
    sortable: true,
    editable: true,
    columns: [
    { text: 'First Name', datafield: 'firstname', width: 100, sortable: false, editable: false }, // the first column is neither sortable nor editable
    { text: 'Last Name', datafield: 'lastname', width: 100 },
    { text: 'Product', datafield: 'productname', width: 180 },
    { text: 'Quantity', datafield: 'quantity', width: 80, cellsalign: 'right' },
    { text: 'Unit Price', datafield: 'price', width: 90, cellsalign: 'right', cellsformat: 'c2' },
    { text: 'Total', datafield: 'total', width: 100, cellsalign: 'right', cellsformat: 'c2' }
    ]
    });

    Best Regards,
    Dimitar

    jqWidgets team
    http://www.jqwidgets.com/

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.