Foro

Precarga a la Grilla

0
Eh puesto precarga ah algunas Cosas que eh echo, para que se sea mas ordenado, pero como le pongo una precarga ah mi Ventana Windows, para mi que carge mi grilla
favoritoDataStore = new Ext.data.Store({
      id: 'favoritoDataStore',
      proxy: new Ext.data.HttpProxy({
                url: 'contacto.php', 
                method: 'POST'
            }),
            baseParams:{envio: "LISTAR"}, 
      reader: new Ext.data.JsonReader({
        root: 'results',
        totalProperty: 'total'
        //id: 'id'
   },[ 
	  	{name: 'id_entidad', type: 'string', mapping: 'id_entidad'},
		{name: 'st_media', type: 'string', mapping: 'st_media'},
		{name: 'st_nombre', type: 'string', mapping: 'st_nombre'},
		{name: 'st_empresa', type: 'string', mapping: 'st_empresa'},
        {name: 'st_agenda', type: 'string', mapping: 'st_agenda'}
      ]),
      sortInfo:{field: 'st_nombre', direction: "ASC"}
    });
    
  favoritoColumnModel = new Ext.grid.ColumnModel(
    [{
        header: 'Fotos',
        dataIndex: 'st_media',
		id: 'st_media',
		name: 'st_media',
        width: 100,
		renderer:cover_image
      },{
        header: 'Nombre',
        readOnly: true,
        dataIndex: 'st_nombre',
        width: 230
        },/*{
        header: 'Cargo/Posicion',
        dataIndex: 'st_cargo',
        width:110
     
      },*/{
        header: 'Empresa',
        dataIndex: 'st_empresa',
        width: 340
     
      },/*{
        header: 'Exibidor Asociado',
        dataIndex: 'st_exhibi',
        width: 110
    
      },*/{
        header: 'Agenda',
        dataIndex: 'st_agenda',
        width: 60
    	
      },{
        header: 'Perfil',
        dataIndex: 'id_entidad',
        width: 70,
    	renderer: url_perfil
      }]
    );
  
   function cover_image(val){
  			return '<img src=../../upload/media/'+val+' width="50" height="50">';
	};
	function url_perfil(val){
	return '<a href="_perfil.php?id='+val+'"><img src=images/user.png></a>';
	}
		 
		 
    favoritoColumnModel.defaultSortable= true;
  
     favoritoListingEditorGrid =  new Ext.grid.EditorGridPanel({
      id: 'favoritoListingEditorGrid',
      store: favoritoDataStore,
      cm: favoritoColumnModel,
	  	  listeners: {
         rowclick: function(grid,rowindex,e){
                   var fila=grid.getStore().getAt(rowindex);
				    agendaCreateForm.getForm().reset();
                   Ext.getCmp('id_citaField').setValue(fila.get('id_entidad'));
                    //Ext.Msg.alert("ID: "+fila.get('idespecialidad'));                 
               // Ext.Msg.alert("Campo Oculto "+   Ext.getCmp('numField').getValue());
				}},
      enableColLock:false,
	   stripeRows: true,
      clicksToEdit:1,
      selModel: new Ext.grid.RowSelectionModel({singleSelect:false}),
	   bbar: new Ext.PagingToolbar({
                pageSize: 10,
                store: favoritoDataStore,
                displayInfo: true
            }),
      tbar: [{ 
            text: 'Borrar Contactos',
            tooltip: 'Seleccione un Contacto ',
            handler: confirmDeletefavorito,   
            iconCls:'remove'
			 }, '-', {
            text: 'Busqueda de Contactos',
            tooltip: 'Busqueda Avanzada',
            handler: startAdvancedSearch, 
            iconCls:'search'  
		 },'-',{
         text: 'Solicitar un Cita',
			tooltip: 'Seleccione un Contacto antes de Solicitar una cita.',
         iconCls:'add',    // this is defined in our styles.css
         handler: displayFormWindow
      }]
	  
    });
    
  favoritoListingWindow = new Ext.Window({
      id: 'favoritoListingWindow',
      title: 'MIS FAVORITOS - CONTACTOS IIMP',
      draggable:false,
      closable:false,
	  resizable : false,
	  x:0,
	  y:0,
      width:854,
      height:350,
      plain:true,
      layout: 'fit',
      items: favoritoListingEditorGrid
    });
  favoritoDataStore.load({params: {start: 0, limit: 10}});
  favoritoListingWindow.show();
0
si lo que quieres es ya lo tenga cuando se quiera mostrar la ventana, solo tendrías que agregar en la ventana
, items: [tugrilla,item2,....]
así quedarán cargados automáticamente en tu ventana, espero que sea lo que buscas. salu2 Crespo
0
Gracias Crespo. .Bueno, en realidad lo que quiero es precargar el Ext.window, osea el windows se demora un poco para cargar, y quiero que mediante una precarga me avize que algo se esta cargando.
0
prueba con esto
Loadmask:true
y si no funciona con esto otro:
var ventanaMask = new Ext.LoadMask(tuventana.getEl(),{msg:'Realizand ocambios...'});
ventanaMask.show();
y para despues de la accion
ventanaMask.hide();
ventanaMask.destroy();

¿Conoces a alguien que pueda responder esta pregunta? Comparte el link en Twitter o Facebook

Es necesario registrarse para poder participar en el foro! Si ya tienes una cuenta puedes entrar y comentar en este foro.