Could someone please show me how to add a combo box to a grid column when using attachGrid() to a layout and Connector ? I have checked the documentation but I can’t figure it out.
I then pull in data via get_urls (this is using CodeIgniter and phpci):
[code] public function get_urls()
{
$this->load->database();
$this->load->model(“url_model”);
$connector = new GridConnector($this->db, “phpCI”);
$connector->configure(“tblurl_custom”, “id”, “domain, path, category”);
$connector->useModel($this->url_model);
$connector->render();
}[/code]
This works fine if I just want to edit cells as text input boxes. I want to make the 3rd column a drop down when double clicked, which uses a list of values also obtained from the database. How do I go about this ? It does not seem to be covered clearly in the examples.
I had a look at Excell’s but it still doesn’t make sense to me.
Thank you… I could not find the first link when searching the docs. I will try with this approach, it looks like it should work for me. If I can get a proof of concept working I will be able to purchase the Pro version
Using the method above, how can I set the option ID and value ? Right now the query returns the category name only. How do I tell the treegrid to use one field as ID and another field as value ?
My query would be changed as follows:
select tblurl_custom.id as id , tblurl_custom_categories.id as category_id, tblurl_custom_categories.category as category, tblurl_custom.domain as domain, tblurl_custom.path as path FROM tblurl_custom, tblurl_custom_categories WHERE tblurl_custom.category_id = tblurl_custom_categories.id AND tblurl_custom_categories.is_bypass = 0
So in the grid column 1 = domain, column 2 = path, column 3 = category but within the 3rd column combo it should use:
<option value="CATEGORY_ID">CATEGORY</option>
rather than
<option>CATEGORY</option>
This will make it easier for updating the database once the combo box has changed.
Thanks
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan