Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

jqGrid client-side searching -


i manually apply searching jqgrid via javascript. have tried guide here, can't seem working. in grid setup have column name 'error_column' perform search on looking string 'test'.

here have far:

var filter = { "field": "error_column", 'oper': 'eq', "data": 'test' }; $("grid2").jqgrid('setgridparam', { search: true, postdata: { filters: filter} }) $("grid2").trigger('reloadgrid'); 

when click button bound to, nothing happens , causes no errors.

edit here code initializing grid:

jquery("#grid2").jqgrid({     datatype: "local",     height: 250,     colnames: ['newsubscriberid', 'conflicting subscriber id', 'error field', 'error message'],     colmodel: [         { name: 'new_subscriber_id', index: 'new_subscriber_id', width: 120},         { name: 'conflicting_subscriber_id', index: 'conflicting_subscriber_id', width: 170},         { name: 'error_column', index: 'error_column', width: 90, sorttype: "text", search: true},         { name: 'error_type', index: 'error_type', width: 145}     ],     loadonce: true     }); 

i bind data grid using local array.

you should implement search single field in little way:

var grid = jquery("#grid2"); var postdata = grid.jqgrid('getgridparam','postdata'); jquery.extend (postdata,                {filters:'',                 searchfield: 'error_column',                 searchoper: 'eq',                 searchstring: 'test'}); grid.jqgrid('setgridparam', { search: true, postdata: postdata }); grid.trigger("reloadgrid",[{page:1}]); 

you can see live example here.

updated: use loadonce: true , datatype: "local" together. value loadonce: true ignored in case of datatype: "local". if data server , use datatype: "json" or datatype: "xml", loadonce: true work. if want searching (filtering) done not locally on server instead should reset datatype 'json' or 'xml' additional option of 'setgridparam'.


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -