Welcome, Guest
Username: Password: Remember me

TOPIC: Filter list by integer field

Filter list by integer field 22 Jun 2012 12:25 #2609

Hi all,

How can I apply one of my integer fields as a filter on a list of records?

I have a field called 'fund_entry_state', it is an integer and and has a value of either 1, 2 or 3 for example!

I might yet create a lookup table for this field as these numeric values have a meaning (new, shortlisted and rejected).

Hmm, and ideas how I would go about this in the j-cook builder?

Best regards,
K...
The administrator has disabled public write access.

Re: Filter list by integer field 22 Jun 2012 13:14 #2615

OK, I got around this by using a lookup table. However it would be nice to know how to do the same with a predefined dropdown list for example!

Thanks,
K...
The administrator has disabled public write access.

Re: Filter list by integer field 22 Jun 2012 17:46 #2618

  • etc
  • etc's Avatar
  • Offline
  • Premium Member
  • Posts: 132
  • Thank you received: 19
  • Karma: 7
Hi,

Do you mean something like "enumeration" in Data Types?
The administrator has disabled public write access.

Re: Filter list by integer field 25 Jun 2012 08:58 #2633

Thanks for your reply but I not sure I understand!

However, I have got around this by implementing a lookup table. Admittedly it is a little bit of an overkill considering that this new lookup table will only ever have 3 values. Would have been nice to have this hard coded I guess but time is of the essence, as always. Plus as this is an admin task it is never going to be too intensive, unlike the front-end implementation which I have coded myself instead of using this CRUD builder, I reckon we can get away with it.

I could, I guess, replace the model used for this lookup with my static 3 values. Might look at doing this near the end of development.

Thanks,
K...
Last Edit: 25 Jun 2012 09:00 by kristianharmer.
The administrator has disabled public write access.

Re: Filter list by integer field 25 Jun 2012 09:09 #2635

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
I don't understand at all what are you asking for :oops:
I have coded myself instead of using this CRUD builder
Note for users : CRUD means "Create, read, update and delete" -> Model features of the component

Why ?
In a Joomla component, you shouldn't bypass the native model. it is not clean, but still possible of course.
Coding is now a piece of cake
The administrator has disabled public write access.

Re: Filter list by integer field 25 Jun 2012 09:18 #2636

Hey Admin,

What I meant was, I haven't used J-Cook for front end, just admin only.

With regards to bypassing the model. Well as the model for my lookup is a bit of an overkill I guess I can hard code the desired values inside the model; this way no actual SQL query is carried out. I am doing this as I couldn't find a way to create a filter based on a static set of values!

(My filter has 3 values; 1, 2 and 3 with a text description for each. I could only get this filter working by implementing a lookup table.)

Thanks,
K...
The administrator has disabled public write access.

Re: Filter list by integer field 25 Jun 2012 09:40 #2639

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
Yes it is possible.
Use the "Enumeration" field type.

Then , drop it in a combo filter.

That's it.
Coding is now a piece of cake
The administrator has disabled public write access.
The following user(s) said Thank You: kristianharmer

Re: Filter list by integer field 25 Jun 2012 14:22 #2656

Fantastic, will give that a try.

Tool is great by the way; has saved me days on implementing the CRUD for administrators. :-)

Thanks,
K...
The administrator has disabled public write access.
Time to create page: 0.068 seconds

Get Started