I want to resize my grid that inside another grid. These grids are hierarchical. I wrote something for that but this works for second click. The processes I mentioned are seen in the pictures (firstclick, secondclick). the red circle shows extand button.
The js code block I wrote for solution but it does not work properly:
// The code inside the databound function of master grid
$("#SiparisListeleGrid td a.k-icon").click(function () { // onclick for a element that opens second grid inside the row
if ($(this).hasClass("k-i-expand")) { // if the grid is expand
// uid of tr element
var tr_UID = $(this).parents("tr").data("uid");
// master grid
var ustGrid = $("#SiparisListeleGrid").data("kendoGrid");
$(ustGrid.dataSource.data()).each(function (i, item) {
if (item.uid == tr_UID) {
var altGrid = $("#Grid_SiparisSatir_" + item.SipUstID).data("kendoGrid");
var rowCount = altGrid.dataSource.view().length;
$("#Grid_SiparisSatir_" + item.SipUstID).attr("style", "height:" + (rowCount * 40 + 125) + "px;");
$("#Grid_SiparisSatir_" + item.SipUstID + " .k-grid-content").css("height", (rowCount * 40));
$("#Grid_SiparisSatir_" + item.SipUstID + " .k-grid-content-locked").css("height", (rowCount * 40));
}
});
}
});
// This code block only works on second clicking the expan button.
// Does not recognize the second grid when clicked for the firs time
// Should I use databound for second grid? However I do not know how can I do that.
Hi,
I have an observable array of observables which is linked to a kendo grid as datainput. I am trying to sort it by clicking on column header. I have made the sortable : true. But the issue is when the array is
self.array = ko.observableArray([{ Cabin: 'eco' }, { Cabin: 'taper' }]); The sorting works
But If the array is
self.AllocArray = ko.observableArray([{ Cabin: ko.observable('eco') }, { Cabin: ko.observable('taper') }]); then the sorting doesn't work.
Is there any possible solution around this?
Many thanks,
Jason
We have two grids in our site that have a custom command button declared similarly to this:
columns.Command(cmd => cmd.Custom("Unaudit").Click("unaudit")).Width(60);
unaudit is a javascript function. Works ok but inside unaudit we have to jump through hoops to get the data we want, the id of the record in that grid row.
var id = this.dataItem($(e.currentTarget).closest("tr")).ID;
Is there a way to access the data object and pass just a field to the javascript function?
example (not working)
columns.Command(cmd => cmd.Custom("Unaudit").Click("unaudit(data.ID)")).Width(60);
Help is appreciated. Thanks. Note that if i am required to use a client template column instead, i do know how to do that but was hoping i wouldn't have to do that.