Forum


23:33

04/11/2011

I am passing objects to my grid and using a formatter to display it correctly. The whole grid is running locally so the search should be running through javascript.
For instance I pass in
EmployeeID, FirstName, LastName, Job, etc and use that to create the first column of my table.
The problem I have is when I search... the only thing that it finds is "object" not the fields. How can I write a custom search function so it only searchs FirstName or LastName.
Thanks
08:49

Moderators
30/10/2007

Hello,
How is your object constructed.
The below is not tested, but maybe if you define the index property in appropriate way it should work.
Suppose you object is myobject : { FirstName: …, }, then the index in colModel can look like this
colModel :[
{ ... index: myobject.FirstName ... }
...
]
Regards
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
23:37

04/11/2011

Thanks for the help Tony...
I don't know why I didn't think of that. I think it confused me because right now I am letting it parse it...s o I setup my model and it parses everythign correct grabbing the object (so I didn't think of setting the index as Employees.FirstName).
But it worked like a charm.
Thanks a lot!!!
Most Users Ever Online: 715
Currently Online:
58 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