Results 1 to 6 of 6

Thread: Work with php and need to send a variable of a tab1 to tab2 by url and load a form

  1. #1

    Question Work with php and need to send a variable of a tab1 to tab2 by url and load a form

    do not speak English, using a translator, I am beginning to use the libraries of ext2 I was difficult because everything is in English, I need you to help me, please is as follows:

    es con el TABPANEL quiero cambiar de tab atravez de un link

    I am in a form I click on a link that takes me to necestito as I tab2
    Work with php and need to send a variable of a tab1 to tab2 by url and instead load a form

    this code

    panel1.html
    Code:
    <html>
    <head>		    
        <script language="JavaScript" type="text/javascript" src="../funciones/javascript/funcionesJS.js"></script>
     	<script language="JavaScript" type="text/javascript" src="adapter/ext/ext-base.js"></script>
        <script language="JavaScript" type="text/javascript" src="ext-all.js"></script>
    	<script language="JavaScript" type="text/javascript" src="examples/tabs/tabs.js"></script>	  
    	<link rel="stylesheet" type="text/css" href="resources/css/ext-all.css"/>
    	<style type="text/css">	
        .settings {background-image:url(examples/shared/icons/fam/folder_wrench.png);}
        .nav {background-image:url(examples/shared/icons/fam/folder_go.png);}	
    	</style>
    </head>
    <body>  
      <div id="west"></div>
      <div id="north"></div> 
      <div id="south"></div>
     </body>
    </html>
    
    tabs.js
    
    function submitForm() {
    	  // whatever javascript you need can go here...
    	  var panel1 = Ext.getCmp('tab1');
    	  var panel2 = Ext.getCmp('tab2');
    	  panel2.myVar = panel1.myVar; // or whatever
    	}
    function showTab(index) {
    	var tabs = Ext.getCmp('myTabPanel');
    	tabs.setActiveTab( tabs.items.getAt(index) );
    }
        Ext.onReady(function(){
            Ext.state.Manager.setProvider(new Ext.state.CookieProvider());        
           var viewport = new Ext.Viewport({
                layout:'border',
                items:[
    						new Ext.BoxComponent({ // raw
    							region:'north',
    							el: 'north',
    							height:32
                    		}),{
    							region:'south',
    							contentEl: 'south',
    							split:true,
    							height: 100,
    							minSize: 100,
    							maxSize: 200,
    							collapsible: true,
    							title:'South',
    							margins:'0 0 0 0'
    						},{
    							region:'west',
    							id:'west-panel',
    							title:'PANEL',
    							split:true,
    							width: 200,
    							minSize: 175,
    							maxSize: 400,
    							collapsible: true,
    							margins:'0 0 0 5',
    							layout:'accordion',
    							layoutConfig:{
    								animate:true
    							},
    								items: [{		contentEl: 'west',
    												title:'ORDEN',
    												border:false,
    												iconCls:'nav'
    											},{
    												title:'CUENTAS',
    												html:'<p>Some settings in here.</p>',
    												border:false,
    												iconCls:'settings'		
    														
    											},{
    												title:'MANTENIMIENTO',
    												html:'<p>Some settings in here.</p>',
    												border:false,
    												iconCls:'settings'
    										}]
    								},
    				
    						new Ext.TabPanel({
    							id:'myTabs',
    							region:'center',
    							//deferredRender:false,
    							activeTab:0,
    							plain:true,
    							defaults:{autoScroll: true},
    							
    							items:	[{		id: 'tab1',
    											title: 'Ingresar Orden',
    											autoLoad:'../medios/forms/formingresarorden.php'
    										
    										},{
    											id: 'tab2',
    											title: 'Inspeccion General',
    											autoLoad:'../medios/forms/forminspeccion.php'
    										},{
    											id: 'tab3',
    											title: 'Evaluacion por Sistemas',
    											autoLoad:'../medios/forms/formevasistema.php'
    										},{
    											id: 'tab4',
    											title: 'Control Interno Hospitalizacion',
    											autoLoad:'../medios/forms/formhospitalizacion.php'
    										},{
    											id: 'tab5',
    											title: 'Control Farmacos Hospitalizacion',
    											autoLoad:'../medios/forms/formhospitalizacion.php'
    										}
    									]
    						})
    						
    					 // fin new Ext.TabPanel({
    			 ]
    			 
            });
    		
        });
    formingresarorden.php
    Code:
    <form name="Formu" action=""> 
    ...
     <td><a href="#" onclick='javascript:showTab(2)'>view profile</a></td>
    ...
    Last edited by operador; 30 Jan 2008 at 1:38 PM. Reason: Clarify code

  2. #2
    Ext User para's Avatar
    Join Date
    Apr 2007
    Location
    Redmond, WA
    Posts
    918

    Default

    Add Ids
    Code:
    items: [{
    id: 'tab1',
    title: 'Ingresar Orden',
    autoLoad:'../medios/forms/formingresarorden.php'
    },
    ....
    {
    id: 'tab5',
    title: 'Control Farmacos Hospitalizacion',
    autoLoad:'../medios/forms/formhospitalizacion.php'
    }]
    Code:
    <button value="SendToTab" onClick="javascript:submitForm()"/>
    
    function submitForm() {
      // whatever javascript you need can go here...
      var panel1 = Ext.getCmp('tab1');
      var panel2 = Ext.getCmp('tab2');
      panel2.myVar = panel1.myVar; // or whatever
    }

  3. #3
    Ext User para's Avatar
    Join Date
    Apr 2007
    Location
    Redmond, WA
    Posts
    918

    Default

    After getting a private message with more details... here's my new response.

    Code:
    new Ext.TabPanel({
    	id: 'myTabs', // add an id to the tabpanel
    	region:'center',
    	//deferredRender:false,
    	activeTab:0,
    ...............
    
    <a href="#" onclick='javascript:showTab(2)'>view profile</a>
    
    function showTab(index) {
    	var tabs = Ext.getCmp('myTabPanel');
    	tabs.setActiveTab( tabs.items.getAt(index) );
    }

  4. #4

    Default error " undefine is null or not object"

    One cuestions, index is the form name or Referenacia ago to.. ?
    the function Referenacia ago to TabPanel
    this code:
    Code:
    function submitForm() {
    	  // whatever javascript you need can go here...
    	  var panel1 = Ext.getCmp('tab1');
    	  var panel2 = Ext.getCmp('tab2');
    	  panel2.myVar = panel1.myVar; // or whatever
    	}
    function showTab(index) {
    	var tabs = Ext.getCmp('myTabPanel');
    	tabs.setActiveTab( tabs.items.getAt(index) );
    }
        Ext.onReady(function(){
            Ext.state.Manager.setProvider(new Ext.state.CookieProvider());        
           var viewport = new Ext.Viewport({
                layout:'border',
                items:[
    						new Ext.BoxComponent({ // raw
    							region:'north',
    							el: 'north',
    							height:32
                    		}),{
    							region:'south',
    							contentEl: 'south',
    							split:true,
    							height: 100,
    							minSize: 100,
    							maxSize: 200,
    							collapsible: true,
    							title:'South',
    							margins:'0 0 0 0'
    						},{
    							region:'west',
    							id:'west-panel',
    							title:'PANEL',
    							split:true,
    							width: 200,
    							minSize: 175,
    							maxSize: 400,
    							collapsible: true,
    							margins:'0 0 0 5',
    							layout:'accordion',
    							layoutConfig:{
    								animate:true
    							},
    								items: [{		contentEl: 'west',
    												title:'ORDEN',
    												border:false,
    												iconCls:'nav'
    											},{
    												title:'CUENTAS',
    												html:'<p>Some settings in here.</p>',
    												border:false,
    												iconCls:'settings'		
    														
    											},{
    												title:'MANTENIMIENTO',
    												html:'<p>Some settings in here.</p>',
    												border:false,
    												iconCls:'settings'
    										}]
    								},
    				
    						new Ext.TabPanel({
    							id:'myTabs',
    							region:'center',
    							//deferredRender:false,
    							activeTab:0,
    							plain:true,
    							defaults:{autoScroll: true},
    							
    							items:	[{		id: 'tab1',
    											title: 'Ingresar Orden',
    											autoLoad:'../medios/forms/formingresarorden.php'
    										
    										},{
    											id: 'tab2',
    											title: 'Inspeccion General',
    											autoLoad:'../medios/forms/forminspeccion.php'
    										},{
    											id: 'tab3',
    											title: 'Evaluacion por Sistemas',
    											autoLoad:'../medios/forms/formevasistema.php'
    										},{
    											id: 'tab4',
    											title: 'Control Interno Hospitalizacion',
    											autoLoad:'../medios/forms/formhospitalizacion.php'
    										},{
    											id: 'tab5',
    											title: 'Control Farmacos Hospitalizacion',
    											autoLoad:'../medios/forms/formhospitalizacion.php'
    										}
    									]
    						})
    						
    					 // fin new Ext.TabPanel({
    			 ]
    			 
            });
    		
        });

  5. #5
    Ext User para's Avatar
    Join Date
    Apr 2007
    Location
    Redmond, WA
    Posts
    918

    Default

    Oops. Sorry.
    Code:
    new Ext.TabPanel({
    	id: 'myTabPanel', // add an id to the tabpanel
    	region:'center',
    	//deferredRender:false,
    	activeTab:0,
    ...............
    
    <a href="#" onclick='javascript:showTab(2)'>view profile</a>
    
    function showTab(index) {
    	var tabs = Ext.getCmp('myTabPanel');
    	tabs.setActiveTab( tabs.items.getAt(index) );
    }

    Use Code tags.
    Use Code tags.
    Use Code tags.
    Use Code tags.
    Use Code tags.
    Use Code tags.
    Code:
    Use Code tags.

  6. #6

    Question I need to go to a tab through a link on a form

    I want to make is that when you click on this link m sends a tab2
    Code:
    <a href="#">Orden de Registro</a>
    The link is in a form php

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •