jQWidgets Forums
jQuery UI Widgets › Forums › Grid › grid columntype is checkbox,not trigger cellbeginedit cellendedit event!
Tagged: grid checkbox
This topic contains 3 replies, has 2 voices, and was last updated by Yavor Dashev 4 years, 4 months ago.
-
Author
-
January 21, 2021 at 8:05 am grid columntype is checkbox,not trigger cellbeginedit cellendedit event! #114268
Javascript/jQuery, jqxgrid columntype is checkbox,when ceckbox change value ,not trigger cellbeginedit,cellendedit,cellvaluechanged event!
January 21, 2021 at 8:50 am grid columntype is checkbox,not trigger cellbeginedit cellendedit event! #114271Hi, toonice
Would you like to share piece of your code in order to recreate the case you have encountered because I was unable to simulate the error you have mentioned.
Also which version of the grid component do you use?Please, do not hesitate to contact us if you have any additional questions.
Best regards,
Yavor Dashev
jQWidgets Team
https://www.jqwidgets.com/January 21, 2021 at 1:06 pm grid columntype is checkbox,not trigger cellbeginedit cellendedit event! #114273version 11.0.1
<body>
<script>
$(document).ready(function () {
var editCellName = “”;
var jqxGridsource =
{
type: “post”,
datatype: “json”,
contentType: “text/json”,
datafields: [
{ name: ‘id’, type: ‘string’ }
, { name: ‘f1’, type: ‘string’ }
, { name: ‘f2’, type: ‘bool’ }],
url: ‘/EngineerManageQRCodeWCF/EngineerManageQRCodeWCF.svc/DisplayUser’,
formatdata: function (data) {
},
beforeprocessing: function (data) {
reuslt = JSON.parse(data.d);
return reuslt;
},
addrow: function (rowid, rowdata, position, commit) {
},
updaterow: function (rowid, rowdata, commit) {//when ceckbox change value editCellName is null
if (editCellName === “f2”) {
updaterow();
}
}
};
var jqxgriddataAdapter = new $.jqx.dataAdapter(jqxGridsource);$(“#jqxGrid”).jqxGrid({
//rowdetails: true,
width: ‘100%’,
height: ‘100%’,
altrows: true,
pageable: true,
source: jqxgriddataAdapter,
theme: JQWidgetsTheme,
//localization:”zh-CN”,
columnsresize: true,
selectionmode: ‘multiplecellsadvanced’,
pagesize: 30,
autoloadstate: true
pagesizeoptions: [30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90],
pagerrenderer: pagerrenderer,
virtualmode: true,
showtoolbar: true,
editable: true,
enabletooltips: true,
rowsheight: 86
, rendergridrows: function (args) {
return args.data;
},
columns: [{
datafield: “id”, text: “id”, width: 250, editable: true, cellsalign: ‘left’, align: ‘center’
},{
datafield: “f1”, text: “username”, width: 250, editable: true, cellsalign: ‘left’, align: ‘center’
}
,
{
datafield: “f2”, text: “test”, editable: true, width: 60, cellsalign: ‘center’, align: ‘center’, columntype: ‘checkbox’
}
]});
$(“#jqxGrid”).on(‘cellbeginedit’, function (event) {
oldvalue = event.args.value;});
$(“#jqxGrid”).on(‘cellendedit’, function (event) {
editCellName = event.args.datafield;
});
});</script>
<div id=”jqxGrid” style=”margin: 0;”>
</div>
</body>January 22, 2021 at 10:28 am grid columntype is checkbox,not trigger cellbeginedit cellendedit event! #114277Hi, toonice
I was unable to recreate the problem with not triggering cellbeginedit,cellendedit,cellvaluechanged events with the code snippet you have shared in first post.
However the problem in the code you shared is in the ‘updaterow’ function.When the EditCellName is ‘f2’ you call the ‘updaterow’ function again and this is the reason why the checkbox does not change its value. Instead in the ‘updaterow’ function should look like this:` updaterow: function (rowid, rowdata, commit) {
//when ceckbox change value editCellName is null
if (editCellName === ‘f2’) {
commit(true)
}
}`Please, do not hesitate to contact us if you have any additional questions.
Best regards,
Yavor Dashev
jQWidgets Team
https://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.