hi dear.
is possible add oprgroup label in select columns??
example
<select>
<optgroup label=’Expenses’>
<option value=’42’>Accounting Fees</option>
<option value=’60’>Bank Fees</option>
<option value=’23’>Bank Service Charges</option>
<option value=’24’>Books and Publications</option>
<option value=’25’>Cash Discounts</option>
<option value=’43’>Rent</option>
</optgroup>
<optgroup label=’Income’>
<option value=’19’>Sales</option>
<option value=’20’>Services</option>
<option value=’21’>Interest Income</option>
<option value=’22’>Other Income</option>
</optgroup>
</select>
thanks
This is not supported in library now. However you can use dataUrl property which will call a php page that should return this select / optgroup html code and it will fill the dropdown values.
$col[“editoptions”][“dataUrl”] = “my-dropdown.php”;
In this case, you don’t need to set $col[“editoptions”][“value”] property.
Hi Abu,
I use your idea for add optgroup label but, on grid display that column (page_name) display nothing (on edit and add mode works perfect and I have data inserted correctly into table)
My code:
$col = array();
$col[“title”] = “Nume pagina”;
$col[“name”] = “page_name”;
$col[“width”] = “300”;
$col[“edittype”] = “select”;
$col[“formatter”] = “select”;
$col[“stype”] = “select”;
$col[“editoptions”][“dataUrl”] = “drepturi_page_dropdown_test.php”;
$col[“searchoptions”][“dataUrl”] = “drepturi_page_dropdown_test.php”;
$cols[] = $col;
and script drepturi_page_dropdown_test.php is a simple test like:
<select>
<optgroup label=’Test1′>
<option value=’test1_1′>Test1_1</option>
<option value=’test1_2′>Test1_2</option>
</optgroup>
<optgroup label=’Test2′>
<option value=’test2_1′>Test2_1</option>
<option value=’test2_2′>Test2_2</option>
<option value=’test2_3′>Test2_3</option>
</optgroup>
</select>
Please help!
Thanks!
Hi,
I tested it further and you need to set $col[“editoptions”][“value”] property as well (when using formatter select)