jQWidgets Forums

jQuery UI Widgets Forums Grid making a column non-editable

This topic contains 5 replies, has 3 voices, and was last updated by  DaveB 11 years, 11 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • making a column non-editable #11052

    naveen
    Member

    Hi,

    I found below code that makes whole grid non-editable.

    $(‘#jqxgrid’).jqxGrid({ editable: true});

    Is there any such code that makes only particular columns non-editable? Thank you.

    Regards
    Naveen

    making a column non-editable #11053

    Peter Stoev
    Keymaster

    Hi Naveen,

    The pasted code makes the Grid editable. If you want to make it non-editable, do the following:

    $(‘#jqxgrid’).jqxGrid({ editable: false});

    Each column has editable property, too. If you set it to false, the column will not be editable.

    Best Wishes,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    making a column non-editable #11054

    naveen
    Member

    I searched and not able to found the column non-editable property. Do you have an example that shows to make a column non-editable?

    making a column non-editable #11055

    Peter Stoev
    Keymaster

    You can take a look at the columns property in the API documentation. You just need to set the column’s editable property to false,

    In the Example below, the First Name column’s editing is disabled.

                $("#jqxgrid").jqxGrid(
    {
    width: 600,
    source: dataAdapter,
    editable: true,
    theme: theme,
    selectionmode: 'singlecell',
    editmode: 'click',
    columns: [
    { text: 'First Name', editable: false, columntype: 'textbox', datafield: 'firstname', width: 90 },
    { text: 'Last Name', datafield: 'lastname', width: 90 },
    { text: 'Product', datafield: 'productname' },
    { text: 'Quantity', datafield: 'quantity', width: 70, cellsalign: 'right' },
    { text: 'Available', datafield: 'available', columntype: 'checkbox', width: 67 }
    ]
    });

    Best Wishes,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    making a column non-editable #11056

    naveen
    Member

    Thank you, Peter Stoev. You guys helped me a lot. Thanks to you and your team for providing such a wonderful support. Wish you all the best.

    Regards
    Naveen

    making a column non-editable #19768

    DaveB
    Participant

    Hi Peter, similar question. Would you have an example of setting this property after the Grid has already been created? I am having trouble finding the API to change the editable attribute for a column when it is not part of the create block.

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

You must be logged in to reply to this topic.