I’m having a time trying to understand the filter documentation for the connector. I need to populate a grid with rows but only where the ‘uid’ field is some digit. I’ll use 2 for the uid in the example. I must have the filtering occur on the server. It must be untouchable by the client.
Will someone please advise on how to do this?
Here’s the connector php code I came up with …It doesn’t work and throws an exception:
....
$gridConn = new GridConnector($this->db,"MySQL");
global $_log_dir;
$gridConn->enable_log($_log_dir . "/deployments_dhtmx.out");
$gridConn->dynamic_loading(10);
$gridConn->event->attach("beforeFilter","user_filter");
$gridConn->render_table('deployments','id','uid,searchengine,id,ysm_customerid,onBehalfOfUsername,onBehalfOfPassword,google_customerid,google_accountid');
}
function user_filter($filter_by){
$filter_by->add('uid',$this->uid,'=');
}
Can anyone please post the answer that he figured out?
I need to see it also.
…
Nevermind, I think I must change connector.php, to render_sql instead of render_table:
Now say you want to drag from the Books Grid to a Shopping Cart Grid. Your Shopping Cart has:
Quantity Book Price
But your Book Grid had only two columns. You want to set the default Quantity to be 1. I tried to make invisible column in the Book Grid, and “1” inside the invisible column.
$grid->render_sql("Select * from books where itemtype='hardback'","book_id","book_name,book_price","1");
The “1” doesn’t populate the invisible column. Can you suggest a way? Do I have to go through and add “1” to the entire books database table?
Even better would be if I can retrieve the “1” from another table that’s user_preferences, even though the two tables share no other common traits.