function detailInit(e) {
$("<
div
/>").kendoGrid({
dataSource: {
transport: {
read: {
url: "../OrderDetailJson
/",
dataType: "json"
},
},
filter: { field: "orderid", operator: "eq", value: e.data.Id }
},
....
}
public JsonResult OrderDetailJson(int orderid){
...
}
filter: { field: "orderid", operator: "eq", value: e.data.Id }
doesn't work??? I thought it will work like jquery .post/json call but it doesn't.I am using the kendo ui autocomplete on one of my pages. I am having so issues retrieving the value entered in the autocomplete input box. Below is a sample of the code I use to get autocomplete suggestions with a WebMethod via Ajax:
<P>$(
".input_project"
).kendoAutoComplete({<BR>
minLength:
1,<BR>
dataTextField:
"value"
,<BR>
dataSource:
{<BR>
serverFiltering:
true
,<BR>
serverPaging:
true
,<BR>
schema:
{<BR>
data:
"d"
<BR>
},<BR>
transport:
{<BR>
read:
{<BR>
url:
"<remote url>"
,<BR>
data:
function
()
{<BR>
return
{<BR>
valuetocompare:
$(".input_project"
).
val()<BR>
};<BR>
},<BR>
contentType: 'application/json;
charset=utf-8',<BR>
type:
'POST'
,<BR>
dataType:
'json'
<BR>
},<BR>
parameterMap:
function
(options)
{<BR>
return
kendo.stringify(options);<BR>
}</P>
<P>
}<BR>
},<BR>
change:
function
()
{<BR>
var
value =
this
.value();
<BR>
$(
'#selectedProject'
).val(value);<BR>
}<BR>
});<BR></P>
The problem in this case lies in the fact that I have multiple input fields with the same css class to identify my autocomplete fields. The idea is that all these input fields would be having an autocomplete on them. To get an idea of what I am building: I have a table with which contains both spans and div with dynamic id values. To simulate inline editing a toggle visibility on these div and spans.
Normally if you would like to retrieve data from the autocomplete, you would do something like below, but in my case this would not work since there are more input elements that carry the same css class. I know this is not the way to use autocomplete, since normally every input would have it's own identifier. Is there any way I can make this work. Right now I am using hidden fields to store the value entered but I think there should be a more efficient way to accomplish this behaviour.
<
BR
>data: function ()
{<
BR
>
return
{<
BR
>
valuetocompare:
$('#input_project').val()<
BR
>
};<
BR
>
},
element = $('<div></div>');
var firstRow = kendoGrid.tbody.find(">tr:first");
kendoGrid.select(firstRow);
Then my workspaceGrid.Select callback is not called, and the grid.select() returns no elements.
Is there a better way to host the grid when I'm doing unit testing?
I find the syntax for selecting a particular row very awkward. I would be much easier to do
kendoGrid.select(0) to get the first row.
I've followed this post: http://www.kendoui.com/forums/ui/splitter/100-window-height-splitter.aspx with no luck.
I've also copied everything Dimo posted and it doesn't work correctly - similar problem to what I've described above. Not sure if it is an IE9 thing...
$(
"#gridTitles"
).kendoGrid({
dataSource: {
type:
"json"
,
transport: {
read:
"../services/getTitles"
,
parameterMap:
function
(options) {
return
$.extend(options, {
collection: collection
});
}
},
schema: {
model: {
fields: {
Title: { type:
"string"
},
OFLC: { type:
"string"
}
}
}
},
pageSize: 10,
serverPaging:
true
,
serverSorting:
true
},
height: 250,
sortable:
true
,
pageable:
true
,
columns: [{ field:
"Title"
, title:
"Title"
}, { field:
"OFLC"
, title:
"Rating"
}]
});
[{"Title":"Doctor Who and the Daleks","OFLC":"PG"},{"Title":"Doctor Who: Attack of the Cybermen","OFLC":"M"},{"Title":"Doctor Who: Battlefield","OFLC":"PG"},{"Title":"Doctor Who: Beneath the Surface - The Silurian Collection","OFLC":"PG"},{"Title":"Doctor Who: Black Orchid","OFLC":"PG"}]
{[
"SOME KEY"
: [{
"Title"
:
"something here..."
,
"oflc"
:
"something here..."
}]
}