javascript - define an override to onRowFocus in sports.ux.grid.GridView -
- i trying define override onrowfocus in sports.ux.grid.gridview.
- in override, should check new config grid panel , set supressfocus, call super.onrowfocus
- not sure how check new config grid panel
- did research , not sure how update code in new method,
- can guys tell me how update code
http://docs.sencha.com/extjs/4.1.3/#!/api/ext.grid.view
providing code below
/** * @ignore * @method createautotip - helper method create tooltip shows * when element's contents cannot seen. * * @param tooltipelementid id of element */ sports.ux.grid.createautotip = function (tooltipelementid) { return ext.create('ext.tip.tooltip',{ target: tooltipelementid.el, delegate: ':any(.x-grid-cell-inner|.x-grid-hd-inner)', bodycls: 'sports-grid-tooltip', renderto: ext.getbody(), listeners: { beforeshow: function updatetipbody(tip) { var trigger = tip.triggerelement; // // idea scrollwidth>offsetwidth check got link: // http://stackoverflow.com/questions/4927257/text-overflowellipsis-in-firefox-4 // var s = ext.query("[skiptip=true]", trigger); if (!ext.isempty(s) || trigger.scrollwidth <= trigger.offsetwidth) { //tip.body.dom.innerhtml = ''; return false; // don't show tip } tip.body.dom.innerhtml = trigger.innerhtml; return true; } } }); }; /** * gridview extension supporting following features: * * * sports-value column headers. * * hide sorting options if column not sortable, instead of disabling them. * * used {@link sports.ux.grid.gridpanel}. */ ext.define('sports.ux.grid.gridview', { extend : 'ext.grid.view', alias: 'widget.sports.ux.gridview', mixins: { gridviewcompositecolumn: 'sports.ux.grid.gridviewcompositecolumn' }, requires: [ 'sports.util.messagebox' ], /** * @cfg * text shown "sports-value header" popup menu tied columns of grid. */ sports-valueheadertext: 'sports-value header', /** * @cfg * text shown title of popup prompt used enter new column header. */ sports-valueprompttitletext: 'sports-value column heading', /** * @cfg * text shown label next input box on popup prompt * used enter new column name. */ sports-valuepromptmsgtext: 'enter new column heading name', /** * @cfg * message display when name of column not unique among * other columns. */ sports-valuefailedtext: 'sports-value failed: column header "{0}" exists!', /** * @cfg * flag control if hide sort ascending/sort descending when column isn't sortable. * defaults `true`. */ hideifnotsortable: true, /** * @cfg {boolean} restrictsports-value * specify `true` restrict renaming column headers grid. defaults `false`. */ restrictsports-value: false, //@private error_title: 'error - grid component', enabletextselection: true, constructor: function(config){ ext.apply(this, config); this.headerct.addevents({ /** * @event columnsports-value * @param {ext.grid.header.container} ct grid's header container encsportsulates column headers. * @param {ext.grid.column.column} column column header component provides column definition * @param {string} new text */ columnsports-value: true }); sports.ux.grid.gridview.superclass.constructor.apply(this, arguments); // settings point cannot changed outside // allow add sports-value menu. this.headerct.on('menucreate', this.onmenucreate, this); }, /** * @private create menu before shown * @param {object} headerct * @param {object} menu */ onmenucreate: function(headerct, menu) { menu.on('show', this.onmenushow, this); }, //updating method onrowfocus:function(){ console.log("here- on row focus"); //check new config grid panel , this.callparent(); //set supressfocus, call super.onrowfocus this.callsuper(); } });
Comments
Post a Comment