I want my grid to have a "create command". I do know that I can achieve it with the toolbar. However, having a toolbar means having an extra row at the top.
I prefered if I could add a command to the bottom Pageable Bar. A "create command" would fit nicely right to the "refresh command".
Is this possible?
Michael G. Schneider
I prefered if I could add a command to the bottom Pageable Bar. A "create command" would fit nicely right to the "refresh command".
Is this possible?
Michael G. Schneider
4 Answers, 1 is accepted
0
Hi Michael,
addRecord function:
example CSS styles:
Kind Regards,
Vladimir Iliev
the Telerik team
Adding such create command is not supported out of the box, however you can use jQuery to add such button on document ready event:
Add the button next to the refresh button (after the grid is loaded):
$(
"#grid .k-pager-refresh"
).before(
"<a href='javascript: void(0)' onclick='addRecord()' class='pagerAddRecord'>Add</a>"
);
addRecord function:
function
addRecord()
{
var
grid = $(event.srcElement).closest(
".k-grid"
).data(
"kendoGrid"
);
grid.addRow();
}
example CSS styles:
.pagerAddRecord {
float
:
right
;
margin-right
:
6px
;
padding
:
3px
;
width
:
16px
;
height
:
16px
;
}
Kind Regards,
Vladimir Iliev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0

mgs
Top achievements
Rank 1
answered on 04 Mar 2013, 03:40 PM
Hello Vladimir,
thanks a lot. It works perfectly.
Maybe you can think about integrating "adding buttons to the pageable bar" into Kendo. I do not like the toolbar, as it means wasted vertical space, if there are only one or two commands.
Michael G. Schneider
thanks a lot. It works perfectly.
Maybe you can think about integrating "adding buttons to the pageable bar" into Kendo. I do not like the toolbar, as it means wasted vertical space, if there are only one or two commands.
Michael G. Schneider
0
Hi Michael,
Vladimir Iliev
the Telerik team
I would suggest to share your idea at Kendo UserVoice to allow other users vote for it. Most voted ideas are included in next KendoUI releases.
Vladimir Iliev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0