EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: kissmoon on December 28, 2014, 07:50:11 PM



Title: how can let the datagrid's editor is readonly
Post by: kissmoon on December 28, 2014, 07:50:11 PM
how can let the datagrid's editor is readonly?
code:

$("#dg").datagrid({
        toolbar: '#tb',
        singleSelect: true,
        onClickRow: onClickRow,
        columns: [[
             {
                title: 'version',
                field: 'version',
                readonly:"readonly",
                width: 80,
                editor: {
                    type: 'textbox'
                }
             }
         ]]
})

but when run, the version editor can edit,not read only?


Title: Re: how can let the datagrid's editor is readonly
Post by: stworthy on December 29, 2014, 12:24:04 AM
Please set the 'readonly' property to true.
Code:
editor:{
    type:'textbox',
    options:{
        readonly:true
    }
}


Title: Re: how can let the datagrid's editor is readonly
Post by: kissmoon on December 29, 2014, 01:20:54 AM
got it.
thanks.