javascript - Making ExtJS 4 grid content selectable -
The grid in extss4 (save) does not allow content to be selected by default. But I want to make this possible.
I have tried this grid configuration:
viewConfig: {disableSelection: true, stripeRows: false, getRowClass: function (record, line index, lineparm, store) {Return "X-selectable"; }}, With these CSS classes (basically I can see in Chrome targeting every element):
/ * Firefox And allow grid text selection in webkit based browsers * / .x-selectable, .x-selectable * {-moz-user-selection: text! Important; -khtml- User-selection: Text! Important; Webkit-user-selection: text! Important; } .x-grid-row td, .x-grid-summary-row td, .x-grid-cell-text, .x-grid-hd-text, .x-grid-hd, .x-grid-row , .x-grid-row, .x-grid-cell, .x-unselectable {-moz-user-select: text! Important; -khtml- User-selection: Text! Important; Webkit-user-selection: text! Important; } I know that you can override the grid line template in the 3 extensions below, but I do not know how to do this in Ext 4:
Template: {Sale: New Extension. Template ('& lt; td class = "x-grid3-col x-grid3-cell x-grid3-td- {id} x-selectable {css}" style = "{style =" 0 "{cellAttr} & Gt; ',' & lt; div class = "x-grid3-cell-internal x-grid3-col- {id}" {attr} & gt; {value} & lt; / div & gt; ',' Any suggestion was highly appreciated.
You can add it to the column by using the renderer for the
column: [{header: "", dataIndex: "id", renderer: function (Value, metadata, record, line index, cold index, store) {return.self.tpl.applyTemplate (record.data);}, flex: 1}], position: {tpl: new Ext.XTemplate ('& l T; class = "x-grid3-col x-grid3-cell x-grid3-td- {id} x-selectable {css}" style = "{style}" tabIndex = "0" {cellAttr} & Gt; ',' & lt; div class = "x-grid3-cell-internal x-grid3-col- {id}" {attr} & gt; {value} & lt; / div & gt; ',' &
Comments
Post a Comment