This is a migrated thread and some comments may be shown as answers.

Sort Icon with additional controls in column header

1 Answer 134 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Navnit
Top achievements
Rank 1
Navnit asked on 28 Jun 2012, 03:25 AM
We have a custom filtering controls in the column header of the Grid, now when we try to enable sorting then the sort icon appears in a odd location; I would like the sort icon to appear right after the label. Any suggestions on how to achieve that attached is the snapshot of how it looks and below is the markup we have for columns.

<table class='list-entity'>
    <thead>
        <tr>
            <th data-field='Actions' style='width:48px'>&nbsp;</th>
            <th class='filter' data-field='Code' style='width:250px'>
                <label>ID</label>
                <input class='grid-filter' data-field='Code' />
            </th>
            <th class='filter' data-field='Description'>
                <label>Description</label>
                <input class='grid-filter' data-field='Description' />
            </th>
        </tr>
    </thead>
</table>

1 Answer, 1 is accepted

Sort by
0
Navnit
Top achievements
Rank 1
answered on 27 Aug 2012, 05:07 PM
I ended up hacking this on dataBound event, I do it after a delay because the icon is also added by Kendo Dynamically:

 moveSortIconOnDataBinding: function (gridElement) {
            var _element = gridElement;
            return function (arg) {
                setTimeout(function () {
                    _element.find('thead tr th').each(function () {
                        $(this).find('a span').appendTo($(this).find("a label"));
                    });
                }, 3);
            };
        }
Tags
Grid
Asked by
Navnit
Top achievements
Rank 1
Answers by
Navnit
Top achievements
Rank 1
Share this question
or