boolean - Why does the Kendo Grid show false in all records of my grid, even when some have true? -
i have put simple jsfiddle demonstrating issue. has grid 2 records. 1 has true value in in boolean column , other has false.
i have logged data console can see values grid getting.
yet grid shows false both rows.
http://jsfiddle.net/codeowl/khbmt/
thanks time,
scott
code stackoverflow:
var _data = [ { "sl_testdata_id": "1", "sl_testdata_string": "bool 1", "sl_testdata_boolean": "1" }, { "sl_testdata_id": "2", "sl_testdata_string": "bool 0", "sl_testdata_boolean": "0" } ]; var _kendodatasource = new kendo.data.datasource({ transport: { read: function (options) { console.log('transport read event raised - data: ', json.stringify(_data, null, 4)); options.success(_data); } }, schema: { model: { id: "sl_testdata_id", fields: { sl_testdata_id: { editable: false, nullable: false }, sl_testdata_string: { type: "string" }, sl_testdata_boolean: { type: "boolean" } } } }, error: function (a) { $('#testgrid').data("kendogrid").cancelchanges(); } }); // initialize grid $("#testgrid").kendogrid({ columns: [ { field: "sl_testdata_id", title: "id" }, { field: "sl_testdata_string", title: "string" }, { field: "sl_testdata_boolean", title: "boolean" } ], datasource: _kendodatasource });
i found if altered select statement return "true"/"false" tinyint column in database worked. eg;
select sl_testdata_id, sl_testdata_number, sl_testdata_string, sl_testdata_date, sl_testdata_datetime, if (sl_testdata_boolean = 1, "true", "false") sl_testdata_boolean sl_testdata; regards,
scott
Comments
Post a Comment