Hi guys, I've a case where I'm grouping with the grid, but want to sort in a different order.
E.g. by default if my group data field has values A, B, C, D this would be the group order.
I have data that is sorted by sections of data, that have an order the client wants displayed in a priority order.
To simplify it something like:
Display Field Value Sort Field Value
A 2
B 4
C 1
D 3
I want the grouping text to be A, B, C, D, but the order to be C, A, D, B as per the sort field value (a field not to be visible).
I haven't been able to find anyway to do this. Any help greatly appreciated.


Hi
in a kendo grid column I'm trying to render column sparklines from this markup:
<span class="compliance-dev" data-source="-1,-1,-1,1,1,-1,-1,-1"></span>
in grid.dataBound I do this:
var $spans = $(".compliance-dev", "#grid");
$.each($spans, function() {
var $span = $(this);
var ds = $span.data("source").split(',');
$span.kendoSparkline({
data: ds,
//series: [{
// type: "column",
// color: "#ff0000",
// negativeColor: "#0099ff"
//}]
});
});
This renders into a sparkline of type line: https://dojo.telerik.com/UsUluTaK
How do I render the sparkline as a column graph?
/Morten
I am use in popup window TreeList, and bind treeList to array. Simple example http://dojo.telerik.com/OjipACUQ
Update button in popup window save record and array as one record.
Some problems i fix.
Add new record then edit and press cancel, record will be removed, but record is not dirty and not isNew()
How can i fix it?
In my application editing and adding works, in the example does not work. i don't know why.

How do I set the uid for files in the initial file list options for the upload widget?
When I upload files the guid is auto generated and easily available in the upload event via e.files[0].uid
I have saved this information in the database along with the file and can repopulate the widget with previously uploaded files, but not set the uid, a new, different one is generated. I would like to set it so I can use the existing uid when a user clicks remove on a previously uploaded file and I can delete it from the database.
The initial files array seems not to support it, is there another way?
http://docs.telerik.com/kendo-ui/api/javascript/ui/upload#configuration-files

Hi All,
I am working on grid filter and I meet such a problem. The type of field "status" is string and it will return 0 for Female and 1 for Male. I use a template to show "Male" or "Female" instead of "0" or "1" respectively in grid. However, the filter doesn't work because it only receives "0" or "1" and "Female" or "Male" will show nothing in grid. The code is below.
{ 'field': 'status' , 'title': 'Gender', 'width': 110, 'template': "#= status === '1' ? 'Male' : 'Female' #", }
I wanna use filter to accept "Male" or "Female", or create a multiple selection, how should I make it? Thanks for your help.
James

I want to use pagination to display data, but it won't be in a grid form, I would just show some documents in a div, but still want to be able to paginate - i.e. request html for n-th page.
Is this possible?
Hi,
I spent days about that without finding any solution.
The case is simple :
I have a Grid using virtual scrolling and a "nav toolbar" with buttons : "First, Previous, Next, Last".
The nav toolbar purpose is to navigate through the records contained in the grid.
Note that the grid itself is in a kendo TabStrip but at this point, I use the nav toolbar only when the grid is visible. Later, I'll need to resync the grid if the user use the toolbar when the tab ontaining the grid is hidden, but it's another story.
I tried several approaches, here is the last.
Working code for "First" button : In any case, I get the first record selected at the top of the grid
first : function () { if(oTab.oGrid.dataSource.page() != 1){ gotoFirstRow=true; // => the select will occur in dataBound event oTab.oGrid.dataSource.page(1); } else { oTab.oGrid.select("tr:eq('0')"); } }
In databound this code works, simple :
... if (gotoFirstRow){gotoFirstRow=false; oTab.oGrid.select("tr:eq('0')"); }...
The same kind of code works for the "Last" button.
For the "Next" (and "Prev") button, it works untill the grid needs to load data :
next : function () { // The uidNext is set in change event : When a record is selected, I populate
// uidCurrent/idproCurrent for the current record
// uidNext/idproNext for the next record if any (or null if no more record)
// uidPrev/idproPrev for the previous record if any (or null if no more record)
// idpro is a unique field idnetifier all records have
if (typeof uidNext == "undefined"){ // For example when the current selected record is the last one return; } idproToSelect=idproNext; // => So the select will occur in dataBound event. oTab.oGrid.select("tr[data-uid='"+uidNext+"']"); // Now trying to put the selected record at the top of the grid. The goal is that if user use the nav bar, the grid always presents the
// record at the top
var scrollContentOffset = oTab.oGrid.element.find("tbody").offset().top; var selectContentOffset = oTab.oGrid.select().offset().top; var distance = selectContentOffset - scrollContentOffset; oTab.oGrid.wrapper.find(".k-scrollbar-vertical").scrollTop(distance); }
When I use scrollTop, if Kendo needs more records, it loads them. So I continue the process in dataBound event :
A this point, nothing works at all. This this the code in databound event:
if (idproToSelect != null){ oTab.oGrid.element.find("td[data-field='idpro']").each(function(i, item) { if($(item).html() == idproToSelect) { // When I found it, I get the uid in order to select the row
uidToSelect=$(item).parent().attr('data-uid'); }});// The row is selected
oTab.oGrid.select("tr[data-uid='"+uidToSelect+"']");// RAZuidToSelect=null; idproToSelect=null;
// Now trying to put selected row at the top of the grid : not working
var scrollContentOffset = oTab.oGrid.element.find("tbody").offset().top;
var selectContentOffset = oTab.oGrid.select().offset().top;
var distance = selectContentOffset - scrollContentOffset;
oTab.oGrid.wrapper.find(".k-scrollbar-vertical").scrollTop(distance);
}
The problem i that grid nehavior becomes erratic, the scroll position is not right, so most of the time, I think the right record is selected, but it isn't showed. I suspect a problem with scrollTop when used form databound event.
I have a check box and kendo switch,i want the switch to be disabled by check the checkbox and enabled by un-check the checkbox,i think 4 years back this was a question and as it was answered at the time,should be able to do so,any way here is the code:
<input type="checkbox" id="eq1" class="k-checkbox">
<label>Crew Present:</label><input type="checkbox" id="notifications-switch" aria-label="Notifications Switch" disabled="disabled" />
<label>Grid Loss:</label><input type="checkbox" id="notifications-Grid" aria-label="Notifications Switch" disabled="disabled" />
here is the JS:
$(function () {
$("#notifications-switch").kendoMobileSwitch();
//$("#notifications-Grid").kendoMobileSwitch();
});
$("#eq1").change(function () {
debugger;
$("#notifications-Grid").prop("disabled", !$(this).is(":checked"));
});
