Where Condition With POST / GET Not Work
- Single Page
Posted 03 September 2013 - 08:02 AM
Posted 04 September 2013 - 02:38 AM
I don't think it will work like this, having a form where the grid (listing) is.
If you really need to do that use either of the following :
1. create two separate views and on one load your form and on the other the crud. call both views from one controller function
2. ajaxify the form
3. make two differenet controller functions, one for the host one for the crud. the host will contain the form and upon submit will pass the $pid to the other crud function. make sure on this crud function you use the http://www.grocerycrud.com/documentation/options_functions/set_crud_url_path . Obviously you will need to make a composite (combined) view
Well In general this is not a Grocery CRUD issue. It is an MVC design - architecture topic. Good luck.
Posted 06 September 2013 - 17:51 PM
Well In general this is not a Grocery CRUD issue. It is an MVC design - architecture topic. Good luck.
My Friend Davidoster Plz don't mind i think this is the grocery crud issue because if we send post data to function where we use grocery crud library.
if we change form post value to static value(i.e. where('product_id',4)) crud works fine but if use form post value into where clause the clause not work so i think this the the GC issue.
By the way you are Grocery CRUD Ninja so you are right... :)
Posted 06 September 2013 - 22:03 PM
[member=mnish] Ninja doesn't mean anything!
And who's right it doesn't matter. What matters is to help each other here!
And by the way you said it yourself, when sending a static value on the where it works. Doesn't this mean that GC works also?
So check the value you send from the form!
Posted 07 September 2013 - 15:47 PM
Well Mr. mnish,
You can verify the value reaching out to the code / function by many ways...
1 - u can use firefox with firebug addon
2 - u can print_r($_POST)
First - verify what id it is being used to pass the value to the function.. and is it really being passed in or not.
Posted 07 September 2013 - 16:24 PM
Thanx Mr Amit For giving me some beautiful tips but I have already tried both option.
Can you giving an example where we use $crud->where('field_name',$this->input->post('post_variable_name')); thanx in advance.
Posted 07 September 2013 - 22:00 PM
Thanx Mr Amit For giving me some beautiful tips but I have already tried both option.
Can you giving an example where we use $crud->where('field_name',$this->input->post('post_variable_name')); thanx in advance.
As the documentation says, http://www.grocerycrud.com/documentation/options_functions/where
check CI's where since it is exactly the same.
Posted 01 January 2015 - 11:33 AM
affect me also, it's happen because when we load page, it's receive post/get parameter, then after loading grocery crud refresh the result by run ajax request (index/ajax_list),
the problem is, this ajax request don't have our post/get data, so the result reseted as same as without post/get data.