Forum
12:31
19/10/2012
Hello
I'm new to jqgrid, but very impressed of all the possibilties! Congrats!
I'm trying to get my treegrid example to filter (local-data) but it won't. Any ideas what I'm dooing wrong?
<script type="text/javascript">
$(
function () {
'use strict';
var data=[
{ id:
"1", Aktion: "Aktion 1", Datum: "10.1.2012", level: "0", parent: "null", isLeaf: false, expanded: false },
{ id:
"2", Aktion: "Aktion 2", Datum: "9.1.2012", level: "1", parent: "1", isLeaf: false, expanded: false },
{ id:
"5", Aktion: "Aktion 5", Datum: "7.1.2012", level: "2", parent: "2", isLeaf: true, expanded: false },
{ id:
"4", Aktion: "Aktion 4", Datum: "6.1.2012", level: "1", parent: "1", isLeaf: true, expanded: false },
{ id:
"3", Aktion: "Aktion 3", Datum: "8.1.2012", level: "0", parent: "null", isLeaf: true, expanded: false },
];
var grid = $("#treegrid");
grid.jqGrid({
datatype:
'local',
treeGrid:
true,
treeGridModel:
'adjacency',
treedatatype:
'local',
ExpandColumn:
'Aktion',
toolbar: [
true, "bottom"],
colNames: [
"id", "Aktion", "Datum"],
colModel: [{
name:
'id',
index:
'id',
width: 1,
hidden:
true,
key:
true
}, {
name:
'Aktion',
index:
'Aktion',
width: 120,
hidden:
false,
sorttype:
'text',
},
{
name:
'Datum',
index:
'Datum',
width: 120,
hidden:
false,
sortable:
true,
sorttype:
'date'
}, ],
width: 500,
sortname:
'id',
pager:
false,
imgpath:
'/ui-lightness/images',
caption:
'',
loadonce:
true
})
grid[0].addJSONData({ total: 5, page: 1, records: data.length, rows: data });
grid.jqGrid(
'filterToolbar', { stringResult: true, searchOnEnter: true });
});
</script>
Kind regards Mike
Most Users Ever Online: 715
Currently Online:
50 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66