I have a view model object . Here it is.
a{ b : {name : "p",id : "q", type : "text"} }
Here is my view.
<table data-template="myTemplate" data-bind="source: a"></table>
<script type="text/x-kendo-template" id="leadFieldsTemplate">
<tr>
<td>
<input class="k-input k-textbox" data-bind=" attr: b " />
</td>
</tr>
</script>
But above method not working.
Then I change it to like this
<script type="text/x-kendo-template" id="leadFieldsTemplate">
<tr>
<td>
<input class="k-input k-textbox" data-bind=" attr: {name : b.name , id : b.id , type : b.type } " />
</td>
</tr>
</script>
Then it is working. So why the first method not working ???
In all time do I have to mentioned the attributes in the input field before bind them ??
Thank you
Hi, i'm tring to add checkboxes and dropdownlist to my treelist
I saw this exemple for the checkboxes: http://dojo.telerik.com/@gyoshev/ilUxi
but i'm not able to add the template field to my code,.
here's how my view code looks like:
@(Html.Kendo().TreeList<Als.NxAudit.Dtos.RoleOperationDto>()
.Name("treelist")
.Selectable(true)
.Columns(columns =>
{
columns.Add().Field(e => e.Operation.Name).Width(220);
})
.Sortable()
.DataSource(dataSource => dataSource
.Read(read => read.Action("TreeList_Read", "Role"))
.ServerOperation(false)
.Model(m => {
m.Id(f => f.OperationID);
m.ParentId(f => f.Operation.ParentID);
m.Field(f => f.Operation.Name);
})
)
.Height(540)
)
Hello!
I've been chasing this bug that occurs when selecting a row in a grid within a Kendo pop-up window. In all non-IE browsers, I get an issue that causes the pop-up window to jump up when selecting a row. I've narrowed my search down to the Kendo method focusTable() which calls the focus() method on the table in all non-IE browsers. I've read focus() sets the active element and positions the window in the foreground. In contrast, IE's setActive() method does the same without positioning the window. Do you have any suggestions on a work around for this issue?
I've attached some screencasts of the bug below:
Thanks,
Brian
http://screencast.com/t/R8EHG73dW
http://screencast.com/t/YZIZpvv0gYp
I'm having trouble binding the Grid to JSON data which is being delivered across a SignalR PersistentConnection with AngularJS. I'm not using hubs - effectively all that happens is a scope property is being updated, and I'd like the grid to update.
The relevant code that is called on update is:
/* ----- List of Sessions --------------- */$rootScope.$on('Sessions', function (event, result) { $scope.$apply(function () { console.log(result); $scope.result = result; });});I want to bind the grid to $scope.result during the common lifetime of the grid and the connection. I've traced the code above and it's returning a repeating collection of JSON objects in a single parent object called 'data'. It looks like I'm missing something really simple, but I've been through lots of example code and still can't make it work.
Thank you
Colin Dixon
Hi there,
This is a fairly common scenario which others have posted about but can't seem to find a solution. I have a paged Kendo grid loaded from a remote datasource. When the page loads, optionally there is an ID in the querystring representing the ID of a row. I need the grid to go to the page of the grid for that ID.
The approach I'm taking is that in the dataBound event, query the datasource to get the index of the row with that ID, and then use that along with the page size to work out which page to goto. However, I can't seem to find my ID in the datasource if it isn't on the currently visible page. Here is my jQuery code to try and get the index :-
//// jump to page of querystring ID
var ds = $('#grid').data('kendoGrid').dataSource;
var view = kendo.data.Query.process(ds.data(), {
filter: ds.filter(),
sort: ds.sort()
}).data;
var index = -1;
// find the index of the matching dataItem
for (var x = 0; x < view.length; x++) {
if (view[x].QuoteID == "11847") { // hard-coded here for testing but will become a variable from querystring
index = x;
break;
}
}
Is my approach correct, and if so how can I make this work? I need to be able to access the other items in the datasource not on the current visible page. A code example would be appreciated.
Thanks, Mark
I'm trying to load a two level structure into a treeview control.
The structure is like a calendar in that there is a date, followed by 1 or more events on that date.
They problem I have is that it displays correctly using a local array, but not when I get the data from an external source. The
two hierarchical definitions follow:
window.calendarData = new kendo.data.HierarchicalDataSource({
transport: {
read: {
url: "https://admin.medinet.ca/cgi-non/mmb/json_calendar.cgi",
dataType: "json"
}
},
schema: {
model: {
id: "eventId",
hasChildren: "items",
fields: {
eventId: {
editable: false
},
date: {
editable: true
},
items: {
model: {
id: "eventId",
fields: {
eventId: {
editable:false
},
lastname: {
type: "string",
editable: true
}
}
}
}
}
}
}
});
window.calendarDataLocal = new kendo.data.HierarchicalDataSource({
data: [
{
eventId: 0,
date: '2015-08-01',
items: [
{
eventId: 1,
lastname: "poulin",
},
{
eventId: 2,
lastname: "smith",
}
]
},
{
eventId: 3,
date: '2015-08-02',
items: [
{
eventId: 4,
lastname: "jones"
}
]
}
]
});
I'm pretty sure it has to do with my model definition, so if I'm doing something wrong in there please point me in the right direction. I've tried a number of different approaches but so far no luck.
The result I'm seeing is that the for local array the control works as expected, But the remote dataSource shows only the top level nodes and undefined for the lower level nodes.
Here is the div for displaying it.
<div id="mainCalendar">
</div>
<script>
$(document).ready(function () {
$("#mainCalendar").kendoTreeView({
dataSource: window.calendarData,
dataTextField: ["date", "lastname"]
})
});
</script>
Note that the dataTextField uses different name for each level.
Here is a copy of the data as returned from the remote source.
[{
"date":"2015-08-11",
"eventId":0,
"items":[{
"firstname":"Fred",
"stopTime":"11:00",
"startTime":"10:30",
"lastname":"Flintstone",
"type":"paid",
"eventId":1
},
{
"stopTime":"12:44",
"actvity":"lunch",
"startTime":"12:00",
"type":"unpaid",
"eventId":1
}]
},
{"date":"2015-08-12",
"eventId":3,
"items":[{
"firstname":"Kermit",
"lastname":"Frog",
"type":"paid",
"eventId":4
}]
}]
Any help would be appreciated.
Hi,
I'm trying to use the MaskedTextBox to format currency number. However, the fact that we can only set one mask is too limited. For instance, I'd like that if the user write "111", it formats "111". Then if user write an additional number, like "1111", it formats as "1 111", then by adding another number, it formats as "11 111", then "111 111", then "1 111 111" and so on...
Is this possible?
