As on title , i have an example grid from a mysql table, one of field was a online field, he take ( s=online or n=online)
inside a method post if -->
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
i put this -->
// DECODE TABLE FOR ( Online/Offline )
case 'online':
$result = $result->read('categories', $decode, $filterForOnline);
break;
and after this -->
if ($type != 'online') {
$online = new DataSourceResult('mysql:host=localhost;dbname=<dbname>,<user>,<password>, $options);
$online = $online->read('categories', $decode);
$data = &$result['data'];
for ($index = 0, $count = count($data); $index < $count; $index++) {
if ($type == "create") {
$onlineCode = $data[$index]->online;
} else {
$onlineCode = $data[$index]['online'];
}
foreach ($online['data'] as $status) {
if ($status['code'] == $onlineCode) {
if ($type == "create") {
$data[$index]->Status = $status;
} else {
$data[$index]['Status'] = $status;
}
break;
}
}
}
}
the definition of colum is this -->
$category = new \Kendo\UI\GridColumn();
$category->field('Status')
->title('Status')
->template('#=Status.description#')
->editor('onlineDropDownEditor')
->width(180);
and the add to the grid -->
$grid->addColumn($phonenumber, $category, $idmessage, $textdata, $imagedata, $orderDate, $command)
.....
.....
->sortable(true)
->filterable(true)
.....
the editor -->
function onlineDropDownEditor(container, options) {
$('<input data-text-field="description" data-value-field="code" data-bind="value:' + options.field + '"/>')
.appendTo(container)
.kendoDropDownList({
autoBind: false,
dataSource: {
schema: {
data: "data"
},
transport: {
read: {
url: "myurl.php?type=online",
type: "POST",
dataType: "json"
}
}
}
});
}
</script>
it's all working, decode, save data etc etc,
just one think not working on that field, filtering and sorting .. how i can modify the code for have this ?