jQWidgets Forums
jQuery UI Widgets › Forums › TreeGrid › JQXTreeGrid setcellvalue error
This topic contains 2 replies, has 2 voices, and was last updated by ngchagas 1 year, 11 months ago.
Viewing 3 posts - 1 through 3 (of 3 total)
-
Author
-
Hi, what’s wrong with this code ?
Uncaught jqxCore: Invalid parameter ‘[setcellvalue, 3, sel, PROTOCOLO 2]’ does not exist.
var source = { dataType: "json", dataFields: [ { name: "id", type: "string" }, { name: "nome", type: "string" }, { name: "nome_gerente", type: "string" }, { name: "nome_admin", type: "string" }, { name: "sel", type: "string" }, { name: "children", type: "array" } ], hierarchy: { root: "children" }, url: 'api/search_branch.php', id: "id" }; var dataAdapter = new $.jqx.dataAdapter(source, { loadComplete: function () { } }); $GRID.jqxTreeGrid( { source: dataAdapter, altRows: true, hierarchicalCheckboxes: true, checkboxes: true, editable: true, height: 500, localization: JQXGRID_PTBR_LOCALIZATION, width: 875, columns: [ { align: 'center',cellsalign: 'left',datafield: 'nome',text: 'Filial',width: 400, filterable: true }, { align: 'center',cellsalign: 'left',datafield: 'nome_gerente',text: 'Gerente',width: 175,filterable: false, }, { align: 'center',cellsalign: 'left',datafield: 'nome_admin',text: 'Coord Adm',width: 150,filterable: false, }, { text: 'Protocolo', datafield: 'sel', width: 150, align: 'center',cellsalign: 'left' }, ], }); $("#set_checked").on('click', (e) => { var rows = $("#grid").jqxTreeGrid('getCheckedRows'); var rowsData = ""; for (var i = 0; i < rows.length; i++) { if (rows[i].sel == undefined) { //rowsData += rows[i].id + " " + rows[i].nome_gerente + " " + rows[i].sel + "\n"; <strong>$("#grid").jqxTreeGrid('setcellvalue', rows[i].id, 'sel', selecao.label);</strong> $("#grid").jqxTreeGrid('refresh'); } } });
Hi,
The name of the method is not setcellvalue, but setCellValue.
Edit it and everything should be fineBest regards,
Svetoslav BorislavovjQWidgets Team
https://www.jqwidgets.com/Thanks, works like a charm…
-
AuthorPosts
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic.