Page 1 of 1

clear database service request

Posted: Sat Mar 23, 2013 7:28 pm
by Tommy B

In my app I have built a search function that pulls from a tiggzi db and displays results in a list as described in the tiggzi docs video tutorial. what I would like to do is have a button that resetsts the screen kind of like a" clear" button. looking for some JavaScript or built in function.


clear database service request

Posted: Sat Mar 23, 2013 9:54 pm
by Jonathan Clark

Couple suggestions I could think of just off the top of my head....

  1. create a button that sets the where clause of your query service to something that would return no results

  2. User the javascript replacewith() function to select the ul list item div and remove all the returned li elements.

    Hope that gives you some ideas


clear database service request

Posted: Sat Mar 23, 2013 11:40 pm
by Tommy B

I built the page following these instructions.
http://docs.tiggzi.com/tutorials/buil...

the where statement is set in the backend with the REST service. Do you know if I can set the "where" statement using java in the onclick event?


clear database service request

Posted: Sun Mar 24, 2013 5:22 am
by Tommy B

So for now i'm using this.

Tiggzi ('industrytype_input').val("#foo");
rest2011naics.execute({});
Tiggzi ('industrytype_input').val("");

Im sure its not the correct way but it works.....for now.

Anyone have any other ideas?


clear database service request

Posted: Sun Mar 24, 2013 2:25 pm
by maxkatz

That's the right approach. Set any input fields you need to empty or default vales.