Jump to content


How to Add search Filter between two date in list view

search search between two date

  • Please log in to reply
7 replies to this topic

#1 Haseeb Ashfaq

Haseeb Ashfaq

    Newbie

  • Members
  • Pip
  • 4 posts
  • LocationFaisalabad , pakistan

Posted 05 December 2013 - 12:34 PM

Hi friends

 

i am using twitter-bootstrap theme in my application.

my problem is that how i add search Filter between two date in list view search option at the top of GRID.

 

 



#2 Amit Shah

Amit Shah

    grocery CRUD Master

  • Advanced Member
  • PipPipPip
  • 1,192 posts
  • LocationMumbai, India

Posted 05 December 2013 - 05:38 PM

Hi there - since it is a custom solution that you look to implement - i will recommend the same inside the CI's view that gets loaded. The same can be submitted as post to the same controllers action ... set the dates into session and filter the data based on the dates set! That should solve your issue. I will recommend a solution into the session as most of the times the data is going to be retrieved is through Ajax calls and the same will be needed to be filtered.

 

A note of caution - will recommend you parse the availability of the keys into the post .. if those are available - update the value in the session...

 

Happy GCing :)



#3 carperolm

carperolm

    Member

  • Members
  • PipPip
  • 14 posts

Posted 27 February 2014 - 07:54 AM

Hi Amit,

 

Did you finish that code? I'm looking for a similar solution.

 

Thanks



#4 Amit Shah

Amit Shah

    grocery CRUD Master

  • Advanced Member
  • PipPipPip
  • 1,192 posts
  • LocationMumbai, India

Posted 27 February 2014 - 08:32 AM

i did finish and i also deployed the same.. on many of my projects!!

 

Download the file from here and check them out - though they may not look out super intesive like the dashboard styled design.. but its all as per the requirements ... and it suites fine.. gells fine in within the design.



#5 carperolm

carperolm

    Member

  • Members
  • PipPip
  • 14 posts

Posted 03 March 2014 - 09:57 AM

Hi Amit,
 
Thanks for your fast answer.
 
Why did you send me that file? I need to filter search result by date range? Could you share you code or tell me the best way to develop it?
 
Thanks in advance.


#6 Amit Shah

Amit Shah

    grocery CRUD Master

  • Advanced Member
  • PipPipPip
  • 1,192 posts
  • LocationMumbai, India

Posted 03 March 2014 - 07:59 PM

Extreamly sorry dudes - i by mistake shared some1 elses reply along with you... i will look up for the solution i have provided in my earlier project and then share you the same..!!



#7 carperolm

carperolm

    Member

  • Members
  • PipPip
  • 14 posts

Posted 10 March 2014 - 03:55 PM

Hi Amit,
 
Could you indicate me how I should develop the solution? Would be great if you share the code! I'm spending lot of time without any results :(
 
Thanks in advance.


#8 Amit Shah

Amit Shah

    grocery CRUD Master

  • Advanced Member
  • PipPipPip
  • 1,192 posts
  • LocationMumbai, India

Posted 11 March 2014 - 11:03 AM

Well.. i am really sorry for not in position to build anything as such... running out of time in crunch... Wanted to develop an extension for the same but meanwhile i will share you some tips / guide you on the same. Well you can create a custom crud view where u can specify your start / end date with a submit button on the same. When one selects the date range and clicks on submit ... submit it to the action.. .capture the date there.... and store it in session... yes this is very important step .. to store it in session because without it you it wont work.

Now treat the code as every regular other request that would come in. Retrieve the date values from session every time the request comes up... set that in crud->where clause...That should give you your filtered data for sure.

Here is the tip in case you want to clear your search parameters on the revisit of the user to the same page.

http://www.grocerycr...rch-on-revisit/

 

You may add your cleanup code in here along with the existing code...

 

Extremely sorry about the same but will surely put in efforts for building an search / filter plugin (i myself am eagerly waiting to build the same)

 

Happy GCing:)







Also tagged with one or more of these keywords: search, search between two date

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users