PHP Classes

addparam ex 9 to work with fields

Recommend this page to a friend!

      DrasticTools  >  All threads  >  addparam ex 9 to work with fields  >  (Un) Subscribe thread alerts  
Subject:addparam ex 9 to work with fields
Summary:trying to create a form view with a drop down field
Messages:5
Author:yokoho
Date:2010-01-22 18:36:36
Update:2010-08-02 05:33:22
 

  1. addparam ex 9 to work with fields   Reply   Report abuse  
Picture of yokoho yokoho - 2010-01-22 18:36:36
first off great work guys, thanks for doing this.

i am trying to replicate ex9 but instead of selecting tables, i want it to work with a primary key field, which i can select from the drop down menu or search with a text box, and it would create a form view for that individual record. please guide me through this. thanks again.

  2. Re: addparam ex 9 to work with fields   Reply   Report abuse  
Picture of dd dd - 2010-01-24 21:15:51 - In reply to message 1 from yokoho
Hi prasmalla,

Tx for the positive words. About your question: drasticgrid offers in-line editing of fields, not editing via forms. So, we do not understand exactly what you want the addparams example to do.
Maybe with more info, we can help,

dd

  3. Re: addparam ex 9 to work with fields   Reply   Report abuse  
Picture of David M David M - 2010-06-17 20:45:57 - In reply to message 1 from yokoho
prasmalla,

I found DrasticData as I was looking for a data-grid package to use (I'm pretty poor at UI - I need all the help I can get!). My primary need was to be able to select a sub-set of the entire table... like your need.

So using the documentation from the site, I created a 'solution.' The whole solution is posted at:
dissectionbydavid.wordpress.com/201 ...

Short version is this:
1) create a new drop-down that shows unique, primary keys
2) alter the AJAX/javascript to use this new drop-down
3) alter the original class (per it's own comments/notes) to 'grab' the $_REQUEST being sent by step 2
4) extend the 'select()' function of the original class to SELECT * FROM $this->table WHERE YourPrimaryKeyHere = ‘$theVariableFromStep3’” . $this->orderbystr, ...

Personally, I ended up creating a new function that grabbed a list of unique primary-keys that I then used to create the drop-down in step 1 above. A quick-hack would be to create your own drop-down (that's what I show in the link above) of primary keys.

Hope that helps... heck, I hope you check back!
David


  4. Re: addparam ex 9 to work with fields   Reply   Report abuse  
Picture of dd dd - 2010-06-18 07:51:32 - In reply to message 3 from David M
Hi David,

Nice work!
The way you used the addparams option of DrasticGrid is exactly the way the addparams option was intended to be used. Examplegrid 9 uses it to send the tablename, but you can use it to send any variable you need.

A small remark: we may extend drasticGrid with standard filtering functionality (any value of any column), if there are more people interested in it. If there more request we will get into that.

dd

  5. Re: addparam ex 9 to work with fields   Reply   Report abuse  
Picture of David M David M - 2010-08-02 05:33:22 - In reply to message 3 from David M
So lame that I'm doing this, but I moved my blog. The page with more detailed instructions is now at:

dissectionbydavid.wordpress.com/201 ...

Sorry for the lame 'reply'
David