i have filed the name material that in database ,table this field 3 value 1 or 2 or 3
i when data from webservice send to datasource grid . two filed for material send. 1.materailId ,2.materialName
now want materailName display and materalid for sort . ??
i want when onclick materailName sort field materialid ??
i when data from webservice send to datasource grid . two filed for material send. 1.materailId ,2.materialName
now want materailName display and materalid for sort . ??
i want when onclick materailName sort field materialid ??
6 Answers, 1 is accepted
0
Hello,
Atanas Korchev
the Telerik team
We don't understand what you are asking. If you need our assistance please elaborate what the problem is. Sending some code and or screenshots would definitely help. More info can be found here.
Regards,Atanas Korchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
alireza
Top achievements
Rank 1
answered on 29 Nov 2012, 10:05 AM
my design code
in output webservice . pperiod - schoolname - schoolid
i want user when want sort by schoolname .sort by schoolid do.
?
if
$(document).ready(
function
() {
var
tdata = {};
tdata.filter = {};
tdata.filter.Payment = {};
tdata.filter.PageIndex = 10;
tdata.filter.PageSize = 100;
$(
"#grid2"
).kendoGrid({
height: 250,
sortable:{
info:
true
},
filterable:
true
,
columnMenu:
true
,
pageable: {
info:
true
},
// enable paging
columns: [
{ field:
"PPeriod"
, title:
"period"
, filterable:
false
, sortable:
false
},
{ field:
"PSchoolName"
, index:
'PSchoolid'
, title:
"school name "
, sortable:
true
}
],
dataSource: {
serverPaging:
true
,
serverSorting:
true
,
serverFiltering:
true
,
pageSize: 500,
sortable:
true
,
filterable:
true
,
pageable:
true
,
pageable: {
refresh:
true
,
pageSizes:
true
},
schema: {
data:
"d.Data"
,
total:
"d.Total"
,
// ASMX services return JSON in the following format { "d": <result> }. Specify how to get the result.
model: {
// define the model of the data source. Required for validation and property types.
fields: {
PPeriod: { type:
"string"
},
PSchoolName: { type:
"string"
}
}
}
},
transport: {
read: { type:
"POST"
,
url:
"/WebService/Paymentsell.asmx/ReadSell"
,
contentType:
"application/json; charset=utf-8"
,
dataType:
"json"
,
data: tdata
},
parameterMap:
function
(options) {
if
(options.sort != undefined) {
if
(options.sort[0] != undefined) {
options.filter.OrderBy = options.sort[0].field;
options.filter.Order = options.sort[0].dir;
}
}
options.filter.PageIndex = options.page;
return
kendo.stringify(options);
// kendo.stringify serializes to JSON string
}
}
}
});
i want user when want sort by schoolname .sort by schoolid do.
?
if
options.sort[0].field == "schoolname"
options.sort[0].field
="schoolid";
i want this work do in bellow :
field:
"PSchoolName"
, index:
'PSchoolid'
index for sort ?
columns: [
{ field:
"PPeriod"
, title:
"period"
, filterable:
false
, sortable:
false
},
{ field:
"PSchoolName"
, index:
'PSchoolid'
, title:
"school name "
, sortable:
true
}
],
0
Hello,
Atanas Korchev
the Telerik team
It seems that you have enabled serverSorting. In this case the actual sorting is not performed by Kendo UI but by the developer. This means that you should implement sorting by all fields necessary in your code (the web service method).
Regards,Atanas Korchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
alireza
Top achievements
Rank 1
answered on 29 Nov 2012, 11:31 AM
This means havenot parametrs for sort field .for exampale.
field for display and index for sort .
other plugin have items index for sort field.
??
field:
"PSchoolName"
, index:
'PSchoolid'
field for display and index for sort .
other plugin have items index for sort field.
??
0
Accepted
Hi,
Atanas Korchev
the Telerik team
If you just need to display a different field use the template of the column:
columns: [
{
field: "field1", // is used for sorting, filtering etc
template: "#= field2 #" // used for display
}
]
Atanas Korchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
alireza
Top achievements
Rank 1
answered on 29 Nov 2012, 12:12 PM
resolve this problem .
thanks
thanks