Dns.js 2.26 KB


function renderercell(value, metaData, record, row, col, store, gridView) {
	return '<div style="font-size: 18px; color:#FFFFFF; background-color:#3892d3 !important; text-align:center;">'+value+'</div>';	
}


Ext.define('App.view.Dns', {
    extend : 'Ext.grid.Panel',
    xtype  : 'mvvm-DnsView',
    title : 'DNS сервера',
    store : 'Dns',
   
    tbar: {
        items: [{
		                xtype: 'button',
		                iconCls:'new',
		                itemId: 'newDnsButton',
		                text: 'Добавить',
		                action: 'add'
		            },
		            {
		                xtype: 'button',
		                iconCls:'remove',
		                itemId: 'deleteDnsButton',
		                text: 'Удалить',
		                action: 'delete',
		                disabled:false
		            },
		    ]
    		},
    		
    		
    		
    		bbar: {
    	        items: [ {
    			                xtype: 'button',
    			                iconCls:'save',
    			                itemId: 'SaveDnsButton',
    			                text: 'Сохранить',
    			                action: 'save',
    			                disabled:false
    			            },
    			            {
    			                xtype: 'button',
    			                iconCls:'load',
    			                itemId: 'LoadDnsButton',
    			                text: 'Обновить',
    			                action: 'load',
    			                disabled:false
    			            }
    	            ]
    	    		},		
    		
    		
    		
          	 width: 500,
             height: 300,   
          	 selType: 'rowmodel',
             plugins: [new 	Ext.create('Ext.grid.plugin.RowEditing', {
                    	   		clicksToEdit: 2,
                    	   		pluginId: 'modelDnsEditPlagin'
                       	})
             ],
             columns: [{ 
				            text      : '№',  
				            dataIndex : 'id', 
				            flex: 1,
				            hidden:true
             			},
				       { 
				            text      : 'HOST', 
				            dataIndex : 'ip', 
				            flex      : 5,
				            renderer:renderercell,
				            editor: new Ext.form.TextField({
				            	allowBlank: true
				            })
				       }
      		  ]
});