Results 1 to 2 of 2

Thread: Pass parameters with a button handler

  1. #1
    Sencha User
    Join Date
    Dec 2008
    Location
    France
    Posts
    321

    Default [RESOLVED] Pass parameters with a button handler

    I' ve a formpanel with somefield.
    I've a panel with some buttons.
    When i click on the buttons, I want to pass the value of formpanel field with the handler.

    Some field in the FormPanel
    Code:
    .....
    	new Ext.form.ComboBox({
    		....
    		id: 'idjs_stat_domaine',
    		....
    	})
    .....
    Some button in the Panel :

    Code:
    	.....
    	id: 'idjs_imprimer_signales',
    	.....
    	handler: function_imprimer_pdf.createCallback(Ext.getCmp('date_stat_debut').getValue(), Ext.getCmp('date_stat_fin').getValue(), Ext.getCmp('idjs_stat_categorie').getValue(), Ext.getCmp('idjs_imprimer_signales'), 'signales')
    	.....
    The function :
    Code:
    var function_imprimer_pdf = function (date_debut, date_fin, categorie, bouton, statut) {
    	alert('date_debut : ' + date_debut + ' date_fin : ' + date_fin + ' categorie : ' + categorie  + ' statut : ' + statut);
    .....
    }
    In the first load of my web page, date_fin is set with a value.
    I choose some value for the fields in the FormPanel.

    Then, when i click on the button, i've this :
    date_debut : date_fin : Fri Jun 18 2010 00:00:00 GMT+0200 categorie : statut : en_cours

    So, it seems, that the parameters in the handler are set the first time the page is load. After, when i choose value in the FormPanel fields, they aren't pass to the handler.

    When i use a handler without function :

    Code:
    .....
    	handler: function () {
    		var mask = new Ext.LoadMask(Ext.getBody(), {msg:"Impression en cours..."});
    		var date_debut = Ext.getCmp('date_stat_debut').getValue();
    		var date_fin = Ext.getCmp('date_stat_fin').getValue();
    		var categorie = Ext.getCmp('idjs_stat_categorie').getValue().split("__");
    		categorie = categorie[0];
    		alert('date_debut : ' + date_debut + ' date_fin : ' + date_fin + ' categorie : ' + categorie  + ' statut : ' + statut);
    .....
    I've the good values of the parameters.

    SO, what i'm missing ?

  2. #2
    Sencha User
    Join Date
    Dec 2008
    Location
    France
    Posts
    321

Similar Threads

  1. pass parameters of a line
    By mrzakaria in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 6 Apr 2009, 1:33 PM
  2. pass parameters between 2 panel
    By mrzakaria in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 2 Apr 2009, 1:36 PM
  3. Pass Parameters to Handlers
    By Domitian in forum Ext 1.x: Help & Discussion
    Replies: 7
    Last Post: 2 Feb 2007, 3:58 PM
  4. how do you pass parameters?
    By Slapyo in forum Ext 1.x: Help & Discussion
    Replies: 2
    Last Post: 30 Nov 2006, 2:15 PM

Posting Permissions

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