Using jQuery and flexigrid, how can I pass additional values to customize the grid contents?

StackOverflow https://stackoverflow.com/questions/18773532

質問

The usual values are passing via JSON to servlet. However, I have a requirement for a timestamp range (start and stop values) that I need to use IN ADDITION to the regular flexigrid values (page, qtype, query, rp, sortname, sortorder). So, I'd like to add startTime and stopTime with String values such as "09/12/2013 16:03"

I've tried using flexOptions, but must not be using it correctly since I don't get extra values passed. Can anyone tell me how to add these two values to pass along with the others in flexigrid post to server?

役に立ちましたか?

解決

Found the answer. Use this code:

$('#useTimeRange').change(function() {
if( this.checked ) {    //limit events to timestamp range
    //alert("Checked " + startTime + " " + endTime);
    var data = {name: 'startTime', value: $("#startTime").val()};
    var data2= {name: 'endTime',  value:$("#endTime").val()};
    $('.flex5').flexOptions({params: [ data, data2 ]}).flexReload();        
}

Here's the related UI and firebug:

flexigrid extra params

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top