jQWidgets Forums

jQuery UI Widgets Forums Grid one editable column need too many codes?

Tagged: ,

This topic contains 4 replies, has 2 voices, and was last updated by  fgaonet 12 years, 5 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • one editable column need too many codes? #12815

    fgaonet
    Member

    I have a many-columns grid. Only one column need to be editable. So far, I have to code it like:

    $(“#jqxgrid”).jqxGrid({ editable: true });
    $(“#jqxgrid”).jqxGrid(‘setcolumnproperty’, column1, ‘editable’, true);
    $(“#jqxgrid”).jqxGrid(‘setcolumnproperty’, column2, ‘editable’, false);
    //…repeate above line for each other columns
    $(“#jqxgrid”).jqxGrid(‘setcolumnproperty’, column20, ‘editable’, false);

    Is that a correct way? Is it possible to use ‘setcolumnproperty’ overwriting the whole grid editable? Like:

    $(“#jqxgrid”).jqxGrid({ editable: false }); //it is default setting so should be omitted.
    $(“#jqxgrid”).jqxGrid(‘setcolumnproperty’, column1, ‘editable’, true);

    Thanks,

    one editable column need too many codes? #12818

    Peter Stoev
    Keymaster

    Hi fgaonet,

    It is better to set the Grid’s editable properties during the columns array initialization.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    one editable column need too many codes? #12861

    fgaonet
    Member

    Do you mean that my original way is the best and only way?

    one editable column need too many codes? #12863

    Peter Stoev
    Keymaster

    Hi fgaonet,

    What I meant is that the “editable” property is more appropriate to be set when you initialize the Grid along with its columns array, not after that.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    one editable column need too many codes? #12883

    fgaonet
    Member

    Yes, that what I did. My concern is too many codes I need to write explicitly.

    I only need one column editable in my 20-column grid. I have to explicitly set editable with false for all other 19 columns.

    That is ok if no other way.

    Thanks

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

You must be logged in to reply to this topic.