Issue 133: Droplists when using AJAX
Status:  Fixed
Owner:
Closed:  Aug 2008
Project Member Reported by jeff.johnston.mn@gmail.com, Aug 11, 2008
******** NOTES ********

I am adding a DropListFilter to one of the column from the API.

HtmlColumn source = row.getColumn("source");
source.getFilterRenderer().setFilterEditor(new
DroplistFilterEditor());

now,when I render the table,
<td><script type="text/javascript" >var
report_source_options={};report_source_options['FLARE']='FLARE';</
script><div class="dynFilter"
onclick="createDynDroplistFilter(this,'report','source',report_source_options)"
></div></td>

gets appended to the column.
But when I try to click on the column for the drop down there is a js
error that "report_source_options not defined"

My theory is,when I am getting the table first through the ajax
call,no js works,i.e anything within <script></script> does not work.

******** MY NOTES ********

With the dropdown list that would be a bug then. You are correct that it is
a loading issue. I bet the worksheet has the same problem as well. I know
you can load JavaScript by calling the eval() method but the trick would be
to just eval the JavaScript. What returns from the AJAX call is the entire
HTML markup and not just the JavaScript. This will take a little research
to figure out the best approach.

 
Aug 11, 2008
#1 bgo...@e1b.org
Why not do something like this:

onclick="createDynDroplistFilter(this,'report','source', {'FLARE': 'FLARE'})"

instead?  That way you don't need to worry about any script evaluation.
Aug 11, 2008
Project Member #2 jeff.johnston.mn@gmail.com
Thats a really good point! That will be the fix then. I will take a look at the
worksheet as well but I am sure the same refactoring will apply.