jQuery UI Widgets Forums Getting Started Get value of checked rows in Jqxgrid

Tagged: 

This topic contains 1 reply, has 2 voices, and was last updated by  Martin 7 months, 1 week ago.

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

  • eraufi
    Participant

    How get value of checked rows in Jqwidgets. I have jqwidget jqxgrid table and want to get the row ID’s value from checked row I found a code from JQwidgets page but It shows null instead of ID numbers.

    $(“#Home”).jqxGrid(
    {
    width: ‘100%’,
    selectionmode: ‘checkbox’,
    sortable: true,
    filterable: true,
    altrows: true,
    columnsresize: true,
    autoheight: true,
    pageable: true,
    source: employeesAdapter,
    rowdetails: true,
    rowsheight: 35,
    initrowdetails: initrowdetails,
    rowdetailstemplate: { rowdetails: “<div id=’grid’ style=’margin: 10px;’></div>”, rowdetailsheight: 220, rowdetailshidden: true },
    ready: function () {
    $(“#Home”).jqxGrid(‘showrowdetails’, 1);
    },
    columns: [
    { text: ‘father_name’, datafield: ‘father_name’, cellsalign: ‘center’, align: ‘center’ },
    { text: ‘vehicle_type’, datafield: ‘vehicle_type’, cellsalign: ‘center’, align: ‘center’ },
    { text: ‘vechialid’, datafield: ‘vechialid’, cellsalign: ‘center’, align: ‘center’ },
    { text: ‘model’, datafield: ‘model’, cellsalign: ‘center’, align: ‘center’ },
    { text: ‘region’, datafield: ‘region’, cellsalign: ‘center’, align: ‘center’ },
    { text: ‘loc_name’, datafield: ‘loc_name’, cellsalign: ‘center’, align: ‘center’ },
    { text: ‘lasttKM’, datafield: ‘lasttKM’, cellsalign: ‘center’, align: ‘center’ },
    { text: ‘currentKM’, datafield: ‘currentKM’, cellsalign: ‘center’, align: ‘center’ },
    { text: ‘difference’, datafield: ‘difference’, cellsalign: ‘center’, align: ‘center’},
    { text: ‘Print_Report’, datafield: ”, cellsalign: ‘center’, align: ‘center’,cellsRenderer:print_report}
    ]
    });
    $(“#Button1″).on(‘click’, function () {

    var indexs = $(‘#Home’).jqxGrid(‘selectedrowindexes’);
    var row = [];
    var value = ”;
    for (var i = 0 ; i < indexs.length; i++) {
    row.push($(‘#Home’).jqxGrid(‘getrowdata’, indexs[i]));
    value += “‘” + $(‘#Home’).jqxGrid(‘getcellvaluebyid’, indexs[i], “id”) + “‘” + ‘,’;
    }
    alert(value);

    });
    });
    </script>
    </head>
    <body>
    <div id=”Home”></div>
    <button id=”Button1″>getdata</button>
    </body>


    Martin
    Participant

    Hello eraufi,

    Please, take a look at the following Example.

    Best Regards,
    Martin

    jQWidgets Team
    https://www.jqwidgets.com/

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

You must be logged in to reply to this topic.