Forums

Suggestion Chronoform Update a Grid (AJAX?) on click

Tozai_X 12 Jan, 2015
Hi everybody,
I searched around the forum but i couldn't find a clear answer...

I wish to create a simple page for listing records from a table with a text box and button above to filter the result.

Can you suggest me the best way to proceed?

I started use Chronoform 4 to to id, but I have doubts about the correct way to have AJAx event on button click to refresh the table.

Thanks in advance...

MT
darrenhallinan 12 Jan, 2015
I am looking for exactly the same thing I have spent some time looking around with no success.

I wish to use CF5 rather then CC5. Cant seem to use Where Statement anymore. Although you can build where statements using the same way as CC5.

I viewed these pages but don't seem to help me
https://www.chronoengine.com/faqs/70-cfv5/5222-how-do-i-build-a-where-statement-in-cfv5.html
Seemed like this was what i was looking for for had no success
https://www.chronoengine.com/faqs/70-cfv5/5231-building-complex-db-queries-using-the-gcore-framework.html
Seemed completely overkill for what I want.

I intended on using GET so the parameter would be in the url and using LIKE so if the term "Pig" was used it would return "Pigs"
I am sure the code below is what i need just with a small rewrite to get the value from the url.
<?php
return array('model_id.column LIKE' => '%value%');
?>

I wont list all my failed attempts as that is pointless

I have this form in custom code
<form id="search" method="GET"><div class="chronoform-container" id="search"><fieldset class="chronoform-container" id="Search-Images">
					<legend>Search Images</legend><div class="form-group gcore-form-row" id="form-row-multi-6"><div class="gcore-subinput-container" id="fitem-S_Tags"><label for="S_Tags" class="control-label gcore-label-top">Search Tags</label>
<div class="gcore-input-wide pull-left gcore-sub-input gcore-display-table" id="fin-S_Tags"><input name="S_Tags" id="S_Tags" value="" placeholder="E.G Accommodation" maxlength="" size="" class="form-control A" title="" style="" data-inputmask="" data-load-state="" data-tooltip="" type="text" /></div></div>
<div class="gcore-subinput-container" id="fitem-S_Location"><label for="S_Location" class="control-label gcore-label-top">Search Location</label>
<div class="gcore-input-wide pull-left gcore-sub-input gcore-display-table" id="fin-S_Location"><input name="S_Location" id="S_Location" value="" placeholder="E.G Dublin" maxlength="" size="" class="form-control A" title="" style="" data-inputmask="" data-load-state="" data-tooltip="" type="text" /></div></div>
<div class="gcore-subinput-container" id="fitem-S_Description"><label for="S_Description" class="control-label gcore-label-top">Search Description</label>
<div class="gcore-input-wide pull-left gcore-sub-input gcore-display-table" id="fin-S_Description"><input name="S_Description" id="S_Description" value="" placeholder="" maxlength="" size="" class="form-control A" title="" style="" data-inputmask="" data-load-state="" data-tooltip="" type="text" /></div></div>
<div class="gcore-subinput-container" id="fitem-button9"><div class="gcore-input pull-left gcore-sub-input gcore-display-table" id="fin-button9"><input name="button9" id="button9" type="submit" value="Search" class="form-control A" style="" data-load-state="" /></div></div></div></fieldset></div></form>



I am indenting on filtering 3 columns
Tags
Location
Description

My Model ID is: images

So the code below is the closest i can get to that i reckon would work, if I could just replace the S_Value with the actual value entered for that parameter in the url when the for aboves sends it using GET.

<?php
return array('images.Tags LIKE' => '%S_Tags%', 'images.Location LIKE' => '%S_Location%', 'images.Description LIKE' => '%S_Description%');
?>


I am also aware of the following code example but was unable to get it to work with LIKE
So Example Below Seemed To Work For Exact Match
<?php
return array("images.Tags" => $form->data("S_Tags"));
?>


But Add LIKE as in examples above and no joy
<?php
return array("images.Tags LIKE" => $form->data("S_Tags"));
?>


Any and all help/advise welcome!!
GreyHead 14 Jan, 2015
Hi MT,

This might work:
<?php
return array( 'images.Tags LIKE ' => "%{$form->data['S_Tags']}%" );
?>
Note that $form->data[''] is an array and so uses [] not ()

Bob
This topic is locked and no more replies can be posted.