Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- this.jsonStore = new Ext.data.JsonStore({
- proxy : new Ext.data.HttpProxy({
- url: 'rs/environments',
- disableCaching: true
- }),
- restful : true,
- storeId : 'Environments',
- idProperty: 'env',
- fields : [
- 'ConnectionName', 'Type'
- ]
- });
- this.colmodel = new Ext.grid.ColumnModel({
- defaults: {
- align: 'center'
- },
- columns: [{
- header: Accero.Locale.text.adminlogin.connectionsHeading,
- width : 140,
- dataIndex: 'ConnectionName'
- },
- {
- header: Accero.Locale.text.adminlogin.connectionTypeHeader,
- width : 120,
- dataIndex: 'Type'
- }]
- });
- config = Ext.apply({
- enableHdMenu: false,
- border : true,
- stripeRows : true,
- store : this.jsonStore,
- view : new Ext.grid.GridView(),
- header : false,
- colModel : this.colmodel,
- sm : new Ext.grid.RowSelectionModel({singleSelect: true}),
- loadMask: {
- msg: Accero.Locale.text.adminlogin.loadingmask
- }
- }, config);
- var sm = new Ext.selection.CheckboxModel( {
- listeners:{
- selectionchange: function(selectionModel, selected, options){
- // Must refresh the view after every selection
- myGrid.getView().refresh();
- // other code for this listener
- }
- }
- });
- var getSelectedSumFn = function(column){
- return function(){
- var records = myGrid.getSelectionModel().getSelection(),
- result = 0;
- Ext.each(records, function(record){
- result += record.get(column) * 1;
- });
- return result;
- };
- }
- var config = Ext.create('Ext.grid.Panel', {
- autoScroll:true,
- features: [{
- ftype: 'summary'
- }],
- store: this.jsonStore,
- defaults: { // defaults are applied to items, not the container
- sortable:true
- },
- selModel: sm,
- columns: [
- {header: Accero.Locale.text.adminlogin.connectionsHeading, width: 140, dataIndex: 'ConnectionName'},
- {header: Accero.Locale.text.adminlogin.connectionTypeHeader, width: 120, dataIndex: 'Type'}
- ],
- loadMask: {
- msg: Accero.Locale.text.adminlogin.loadingmask
- },
- viewConfig: {
- stripeRows: true
- }
- }, config);
- (function() {
- var originalInitValue = Ext.form.TextField.prototype.initValue;
- Ext.override(Ext.form.TextField, {
- initValue: function() {
- originalInitValue.apply( this, arguments );
- if (!isNaN(this.maxLength) && (this.maxLength *1) > 0 && (this.maxLength != Number.MAX_VALUE)) {
- this.el.dom.maxLength = this.maxLength *1;
- }
- }
- }
- );
- })();
- Ext.override('My.Override.for.TextField', {
- override : 'Ext.form.TextField',
- initValue: function() {
- this.callOverridden(arguments);
- if (!isNaN(this.maxLength) && (this.maxLength *1) > 0 && (this.maxLength != Number.MAX_VALUE)) {
- this.el.dom.maxLength = this.maxLength *1;
- }
- }
- });
- Ext.override('My.Override.for.TextField', {
- override : 'Ext.form.TextField',
- afterRender: function() {
- this.callOverridden(arguments);
- if (!isNaN(this.maxLength) && (this.maxLength *1) > 0 && (this.maxLength != Number.MAX_VALUE)) {
- this.el.dom.maxLength = this.maxLength *1;
- }
- }
- });
Add Comment
Please, Sign In to add comment