List Info

Thread: Re: Enhanced datatable with row filtering and column hiding




Re: Enhanced datatable with row filtering and column hiding
country flaguser name
United States
2007-03-28 17:02:45

If you wanted to make the filtered column dynamic (a drop-down list box of the column headings like "name", "breed", "age"), would it work without having to repull the information. By this I mean, if I recreate the filter based on a change in the drop-down, would the underlying datatable (myDataTable in the example) contain all the records or just the filtered ones? Would the AutoComplete reflect the new values (no longer "Oscar" but "German Shepard") ?

Perry Hoekstra

__._,_.___
.

__,_._,___
Re: Enhanced datatable with row filtering and column hiding
country flaguser name
United States
2007-03-29 10:14:18

Perry:
Yes, it is possible to change the column to "query" against. You would
just change the schemaItem property of the StringFilter.

For example, given this markup:

<select id="fs" onchange=&quot;changeFilter()&quot;>
<option value=&quot;POID";>POID&lt;/option&gt;
<option value=&quot;Title&quot; selected=&quot;true&quot;>Title</option>
&lt;/select&gt;

You could do something like this:

function changeFilter() {
var s = document.getElementById("fs");
var column= s.options[s.selectedIndex].value;
fnFilter.schemaItem=column

}

I created another demo illustrating this:
http://www.geocities.com/andresm1981/YUI-Grid/DynamicFilterDemo.htm

--- In ydn-javascript%40yahoogroups.com">ydn-javascriptyahoogroups.com, <dutchman_mn...> wrote:
&gt;
> If you wanted to make the filtered column dynamic (a drop-down list
box of the column headings like "name", "breed", "age&quot;), would it work
without having to repull the information. By this I mean, if I
recreate the filter based on a change in the drop-down, would the
underlying datatable (myDataTable in the example) contain all the
records or just the filtered ones? Would the AutoComplete reflect the
new values (no longer "Oscar" but "German Shepard&quot;) ?
>
> Perry Hoekstra
>

__._,_.___
.

__,_._,___
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )