Field on main grid ->> decoded with lazy load table on listbox, can't be filtered or sorted

2 posts, 0 answers
  1. Alessio
    Alessio avatar
    3 posts
    Member since:
    Aug 2016

    Posted 06 Feb Link to this post


    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);

    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;

    the definition of colum is this -->

    $category = new \Kendo\UI\GridColumn();


    and the add to the grid -->

    $grid->addColumn($phonenumber, $category, $idmessage, $textdata, $imagedata, $orderDate, $command)




    the editor -->

    function onlineDropDownEditor(container, options) {
        $('<input data-text-field="description" data-value-field="code" data-bind="value:' + options.field + '"/>')
                autoBind: false,
                dataSource: {
                    schema: {
                        data: "data"
                    transport: {
                        read: {
                            url: "myurl.php?type=online",
                            type: "POST",
                            dataType: "json"


    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 ? 

  2. Dimiter Topalov
    Dimiter Topalov avatar
    481 posts

    Posted 08 Feb Link to this post

    Hello Alessio,

    If I understand correctly, you are trying to sort and filter the Grid by a column that is a complex object. This is not supported out-of-the-box, as special custom criteria for comparing objects should be provided.

    You can configure the custom sort comparing criteria for the given column via the configuration option, e.g. sorting by the Category column:

    The custom filtering can be performed server-side (or by providing a custom function to the option), e.g.:

    Further information about configuring a custom transport can be found in the following section of our documentation:

    I hope this helps, but if I am missing something, please describe the scenario, and the desired functionality in further details, and send us a similar isolated runnable project, where the problem can be observed, so I can try providing a more-to-the-point suggestion, if one is available. Thank you in advance.

    Dimiter Topalov
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top