/    Sign up×
Community /Pin to ProfileBookmark

Dynamic query builder help required

Hi,
I need a filter (or a dynamic query builder) for the following html:

1)Each field e.g. project name or path should be able to have include and exclude filters optionally.
2) Include filters are to be used in additive mode i.e show the projects having either ‘micado’ or ‘fwflow’ in path.
3) Exclude filters are to be used in subtractive mode i.e show the projects having neither ‘micado’ nor ‘fwflow’ in path.

Please help. I hope I could clearly state my requirement and the post is readable for you. Please let me know if you need any further explanation.

Thanks in advance !!!

#################################

[CODE]<!DOCTYPE html
PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml” lang=”en-US” xml:lang=”en-US”>
<head>
<title> Collections</title>

</head>
<body bgcolor=”#FFFFFF”>

<h3>All Projects</h3><TABLE BORDER=0 BGCOLOR=”#F5F5F5″><TR><TD>o</TD><TD><a href=”collstat.pl?path=/home/fwflow/temp_clk_camino_tool_clk/nodm/v0.0.0/units/clock_generator/tool/results”>@LIBRARY_NAME@</a></TD><TD><a href=”collstat.pl?path=/home/fwflow/temp_clk_camino_tool_clk/nodm/v0.0.0/units/clock_generator/tool/results”>(/home/fwflow/temp_clk_camino_tool_clk/nodm/v0.0.0/units/clock_generator/tool/results)</a></TD></TR>
<TR><TD>o</TD><TD><a href=”collstat.pl?path=/home/micado/spooler_c65fla/dss/dss.common.default/units/macro/tool/results”>AnalogIP:Test1</a></TD><TD><a href=”collstat.pl?path=/home/micado/spooler_c65fla/dss/dss.common.default/units/macro/tool/results”>(/home/micado/spooler_c65fla/dss/dss.common.default/units/macro/tool/results)</a></TD></TR>
<TR><TD>o</TD><TD><a href=”collstat.pl?path=/home/micado/spooler_c65fla/dss/dss.common.default/units/top/tool_analogip/results”>AnalogIP:Test2</a></TD><TD><a href=”collstat.pl?path=/home/micado/spooler_c65fla/dss/dss.common.default/units/top/tool_analogip/results”>(/home/micado/spooler_c65fla/dss/dss.common.default/units/top/tool_analogip/results)</a></TD></TR>
<TR><TD>o</TD><TD><a href=”collstat.pl?path=/home/micado/spooler_c65lp_OA/dss/dss.common.default/units/top/tool3.2/results”>spooler Regression 3.2</a></TD><TD><a href=”collstat.pl?path=/home/micado/spooler_c65lp_OA/dss/dss.common.default/units/top/tool3.2/results”>(/home/micado/spooler_c65lp_OA/dss/dss.common.default/units/top/tool3.2/results)</a></TD></TR>
<TR><TD>o</TD><TD><a href=”collstat.pl?path=/home/micado/spooler_c65lp_OA/dss/dss.common.default/units/top/tool/results”>spooler Regression 3.3</a></TD><TD><a href=”collstat.pl?path=/home/micado/spooler_c65lp_OA/dss/dss.common.default/units/top/tool/results”>(/home/micado/spooler_c65lp_OA/dss/dss.common.default/units/top/tool/results)</a></TD></TR>
<TR><TD>o</TD><TD><a href=”collstat.pl?path=/home/plls4ws/pll_xg223/dss/dss.common.default/units/main/tool/results”>spooler Regression plls4ws</a></TD><TD><a href=”collstat.pl?path=/home/plls4ws/pll_xg223/dss/dss.common.default/units/main/tool/results”>(/home/plls4ws/pll_xg223/dss/dss.common.default/units/main/tool/results)</a></TD></TR>
<TR><TD>o</TD><TD><a href=”collstat.pl?path=/home/tool/development/dss/dss.common.default/units/flowtest”>FlowTest-TestCollection</a></TD><TD><a href=”collstat.pl?path=/home/tool/development/dss/dss.common.default/units/flowtest”>(/home/tool/development/dss/dss.common.default/units/flowtest)</a></TD></TR>
<TR><TD>o</TD><TD><a href=”collstat.pl?path=/home/fcaprj/wicked_amix/nodm/default/units/clock_generator”>flowtest_cells</a></TD><TD><a href=”collstat.pl?path=/home/fcaprj/wicked_amix/nodm/default/units/clock_generator”>(/home/fcaprj/wicked_amix/nodm/default/units/clock_generator)</a></TD></TR>
<TR><TD>o</TD><TD><a href=”collstat.pl?path=/home/fcaprj/wicked_amix/nodm/default/units/clock_generator/dsi_Results”>flowtest_cells</a></TD><TD><a href=”collstat.pl?path=/home/fcaprj/wicked_amix/nodm/default/units/clock_generator/dsi_Results”>(/home/fcaprj/wicked_amix/nodm/default/units/clock_generator/dsi_Results)</a></TD></TR>

<TR><TD>o</TD><TD><a href=”collstat.pl?path=/home/fwflow/clk_6.0/nodm/v0.0.0/units/clock_generator”>flowtest_cells</a></TD><TD><a href=”collstat.pl?path=/home/fwflow/clk_6.0/nodm/v0.0.0/units/clock_generator”>(/home/fwflow/clk_6.0/nodm/v0.0.0/units/clock_generator)</a></TD></TR>
<TR><TD>o</TD><TD><a href=”collstat.pl?path=/home/fwflow/clk_6.0_rh5/nodm/v0.0.0/units/clock_generator”>flowtest_cells</a></TD><TD><a href=”collstat.pl?path=/home/fwflow/clk_6.0_rh5/nodm/v0.0.0/units/clock_generator”>(/home/fwflow/clk_6.0_rh5/nodm/v0.0.0/units/clock_generator)</a></TD></TR>
<TR><TD>o</TD><TD><a href=”collstat.pl?path=/home/fwflow/clk_AMIXFP2/nodm/v0.0.0/units/clock_generator”>flowtest_cells</a></TD><TD><a href=”collstat.pl?path=/home/fwflow/clk_AMIXFP2/nodm/v0.0.0/units/clock_generator”>(/home/fwflow/clk_AMIXFP2/nodm/v0.0.0/units/clock_generator)</a></TD></TR>

<TR><TD>o</TD><TD><a href=”collstat.pl?path=R:/tool_3.0/tooltest/win/tool3.0_Results_demo”>tool_test_cells</a></TD><TD><a href=”collstat.pl?path=R:/tool_3.0/tooltest/win/tool3.0_Results_demo”>(R:/tool_3.0/tooltest/win/tool3.0_Results_demo)</a></TD></TR>
<TR><TD>o</TD><TD><a href=”collstat.pl?path=/home/micado/c11n_v311/dss/dss.common.default/units/demonstrators/home/steve/tool2.1.1_Results”>tool_test_cells_patch_cells</a></TD><TD><a href=”collstat.pl?path=/home/micado/c11n_v311/dss/dss.common.default/units/demonstrators/home/steve/tool2.1.1_Results”>(/home/micado/c11n_v311/dss/dss.common.default/units/demonstrators/home/steve/tool2.1.1_Results)</a></TD></TR>
</TABLE><P><BR><hr>

<p /><br />
</body>
</html>[/CODE]

######################################

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@007JulienJun 25.2012 — Try to add this code before the end of the body
[CODE]<select onchange="displayS(this.value)">
<option value="0">Choose filter</option>
<option value="+micado">With micado</option>
<option value="-micado">Without micado</option>
<option value="+fwflow">With fwflow</option>
<option value="-fwflow">Without fwflow</option>
</select>
<script type="text/javascript">
function displayS(v){
var rws=document.getElementsByTagName('tr'),list='',lns;
if (!v) return
var withOrWithout=v.substr(0,1)=="+";
var whichWord=v.substr(1);
for (var lng=rws.length,i=0;i<lng;i++) {lns=rws[i].innerHTML;
if (new RegExp(whichWord,"i").test(lns)==withOrWithout) {
lns.replace(/(<a[^>]+>)([^<]+)(</a)/i,function(){list+='n'+arguments[2]});}}
alert(list);
}
</script>[/CODE]
We use a regular expression and a replace with an anonymous function. The arguments of this function give the first link pattern (arguments[0]) and sub-patterns (arguments[2] which correspond to the second brackets gives the linked text)
Copy linkTweet thisAlerts:
@myuserauthorJun 25.2012 — Hi Julien,

I do not need an alert list to be popped up. Please see the following link, I want something like that to be implemented for my case. My filters would not only consider 'micado' and 'fwflow', it could be anything. Please help me along the lines of this below link :

http://www.developerextensions.com/index.php/extjs-grid-query-builder?tmpl=demo
Copy linkTweet thisAlerts:
@007JulienJun 25.2012 — I give you the principles... Take care with other entries. There is 11 metacharacters (*) which have to be escape with a backslash (especially with a new RegExp) ! Good luck...

(*) the opening square bracket [, the backslash , the caret ^, the dollar sign $, the period or dot ., the vertical bar or pipe symbol |, the question mark ?, the asterisk or star *, the plus sign +, the opening round bracket ( and the closing round bracket ). This list could perhaps be shorter with URL...
×

Success!

Help @myuser spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.1,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...