EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: kashumaraz on August 07, 2016, 11:12:31 AM



Title: Add 2 combobox in one datagrid column
Post by: kashumaraz on August 07, 2016, 11:12:31 AM
Hello I would like to know if it is possible to add  two combobox having two different value set in a single column of a datagrid.


Title: Re: Add 2 combobox in one datagrid column
Post by: frankgao on August 10, 2016, 01:55:15 AM
I think it's no problem.
The column you can use the formatter attributes.
Like the bottom codes,You can use the value and set the html element.
this is just a sample, you can use the same method get it.

Code:
                    { field: 'views', title: 'View', width: 50,
                        formatter: function (value, rec, rowIndex) {
                            if(value=='1'){
                                return "<input type=\"checkbox\" id=\"gpcheckboxd"+rec.id+"\"  name=\"gpcheckboxd"+rec.id+"\" onclick=\"checkboxListener("+rec.id+",'gp')\" value='"+value+"' checked='true'>";
                            }
                            else{
                                return "<input type=\"checkbox\" id=\"gpcheckboxd"+rec.id+"\"  name=\"gpcheckboxd"+rec.id+"\" onclick=\"checkboxListener("+rec.id+",'gp')\" value='"+value+"'>";
                            }
                        } }