jQWidgets Forums

jQuery UI Widgets Forums Grid Checkbox in grid

This topic contains 6 replies, has 4 voices, and was last updated by  sirisha 8 years, 5 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
  • Checkbox in grid #3491

    jose Ivan
    Member

    hi,

    well the firts column of my grid it ‘s a checkbox ’cause i want the end user check this to delete the row but i set editmode : selectedcell , so when i select a cell the row selects, so i decide do this …find the first column “checkboxcolumn” and find the checkbox value , but this return undefined, i read  checkbox documentation checkbox has 3 states so i set hasthreestate: false but i doesn’t work.

     $('#jqxgrid').bind('rowselect', function (event) {
    var args = event.args;
    var row = args.rowindex;
    var value = $('#jqxgrid').jqxGrid('getcellvalue', row, getFistCheckboxColumn());
    if (value == 'false') {
    $('#jqxgrid').jqxGrid('unselectrow', row);
    }
    });
    function getFistCheckboxColumn() {
    return $("#jqxgrid").jqxGrid('columns').records[0].datafield;
    }
    $("#jqxgrid").jqxGrid(
    {
    width: 878,
    source: dataAdapter,
    editable: true,
    altrows: true,
    enablehover: true,
    enabletooltips: true,
    enableanimations: true,
    keyboardnavigation: true,
    autoheight: true,
    pageable: true,
    columnsresize: true,
    pageable: true,
    columnsresize: true,
    theme: 'summer',
    editmode: 'selectedcell',
    selectionmode: 'multiplerows',
    theme: theme,
    columns: [
    { <strong>text: 'fila', columntype: 'checkbox', width: 50, datafield: 'c', checked: false, hasThreeStates: false, disabled: true },</strong>
    { text: 'id', columntype: 'textbox', datafield: 'id', width: 50 },
    { text: 'Numero de Cuenta', columntype: 'textbox', datafield: 'Account', width: 150 }
    ]
    });
    Checkbox in grid #3504

    Peter Stoev
    Keymaster

    Hi Jose,

    The column definition does not support the ‘hasThreeStates’ property. The supported properties of the Grid columns are listed in the Grid’s API Reference help documentation here: jquery-grid-api.htm.

    The ‘getcellvalue’ method returns the cell value based on the Row’s Bound Index and a valid DataField in the Data Source. If there’s no such record, i.e if there’s no datafield: ‘c’ in your data source, the returned value will be undefined.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Checkbox in grid #3515

    jose Ivan
    Member

    mmm yap , well this column doesn’t below to my datasource….. so i can’t get the value of my checkbox in this row?

    Checkbox in grid #3522

    Peter Stoev
    Keymaster

    As the CheckBox is a Grid editor, you can get its value when the user edits it.

        $("#jqxgrid").bind('cellendedit', function (event) {
    var args = event.args;
    var value = args.value;
    });

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Checkbox in grid #9612

    Deep Shah
    Member

    How can display column of checkbox without dataField?

    Checkbox in grid #9636

    Peter Stoev
    Keymaster

    Hi Deep Shah,

    Each column in jqxGrid must have a datafield event if it’s not present in your data source. I suggest you to take a look at this demo: customrowsselection.htm.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Checkbox in grid #88704

    sirisha
    Participant

    Hi Peter,

    Is it possible to add three state checkbox to Jqxgrid ‘checkbox’ column?

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

You must be logged in to reply to this topic.