Author Topic: editor checkbox value  (Read 2708 times)

omerix

  • Pro Enterprise
  • Full Member
  • *
  • Posts: 148
    • View Profile
editor checkbox value
« on: September 17, 2014, 08:28:42 pm »
ColModel
Code: [Select]
,{title: "İzleme",dataIndx: "YETKI1",width:75
,editor: { type: "checkbox", style: "margin:3px 5px;" }
,render: function (ui) {
var rowData = ui.rowData;
return "<img src='../QImg/i16/"+rowData['YETKI1']+".png' class='i16'>";
}
}

checkbox true,false but i want checked value='YES', non-checked=''

Editor checkbox Sample demo?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6298
    • View Profile
Re: editor checkbox value
« Reply #1 on: September 18, 2014, 06:09:32 pm »
you could use a column.render callback to display "YES" when true and "" when false. it would change your view only.

If you want to save "YES" and "" in your data then remove dataType: "bool" from the column and implement editor.getData callback
Code: [Select]
                        getData: function (ui) {
                            //debugger;
                            var checked = ui.$cell.find("input").is(":checked");
                            if (checked) {
                                return "YES";
                            }
                            else {
                                return "";
                            }
                        }
« Last Edit: September 18, 2014, 06:29:25 pm by paramquery »