jQWidgets Forums
jQuery UI Widgets › Forums › Grid › Issue disabling cell editing conditionally
This topic contains 2 replies, has 2 voices, and was last updated by svetoslav_borislavov 1 year, 9 months ago.
-
Author
-
When a user clicks on a cell to edit, i want to check the value of another cell in the row and conditionally prevent editing of the cell. I appear to have gotten that part working. The issue i’m having now is the cellbeginedit function appears to be preventing editing of the entire column – not just specific cells. What am i doing wrong?
$("#bomtable").jqxGrid({ pageable: false, editable: true, showstatusbar: true, showaggregates: true, columnsresize: true, theme: 'ui-smoothness', width: '100%', statusbarheight: '22', height:'700', rowsheight:55, selectionmode: 'checkbox', editmode: 'selectedcell', //'dblclick', groupable: true, sortable: true, showgroupsheader: false, groupsexpandedbydefault: true, showtoolbar: true, rendertoolbar: renderToolbarFunction, source: bomDataAdapter, rowdetails: true, showrowdetailscolumn: false, ready: function(){ //togglePaging(); }, columns: [ {text: '', datafield: 'select', width: 58, align: 'center', editable: false, cellsAlign: 'center', cellsRenderer: renderCheckbox}, {text: 'Rev', datafield: 'rev', width: 50, align: 'center', cellsAlign: 'center', renderer: renderHeaders, cellsRenderer: renderCells}, {text: 'HWE Item #', datafield: 'lineNum', width: 80, align: 'center', cellsAlign: 'center', renderer: renderHeaders, cellsRenderer: renderCells,cellbeginedit: function (row, datafield, columntype) { var lineNum = $('#bomtable').jqxGrid('getcellvalue', row, "lineNum"); var poNum = $('#bomtable').jqxGrid('getcellvalue', row, 'poNum'); if (poNum.indexOf("PO") >= 0) { alert("Unable to edit HWE Item # for BOM items with an associated PO."); $("#bomtable").jqxGrid('setcellvalue', row, "lineNum", lineNum); return false; } }},
Disregard, i figured it out. The problem was null poNum values.
Hi,
Thank you for the update!
Please, do not hesitate to contact us if you need any assistance.Best regards,
Svetoslav BorislavovjQWidgets Team
https://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.