Editor input make webapge to focus on last inserted editor

Hi,

When creating a form with Editor inputs, it makes the webpag to scroll down to the last editor initiated

For example :
It will make reglenotes always visible (the whole box when empty, only the first line when filled)

The after Load event append BEFORE the focus to the last editor

formBudget.loadStruct(formBudgetData, function(){ formBudget.setItemFocus('d_interne'); window.location = "#top"; });

Any clues ?

formBudgetData = [

{type: "hidden", name:"ref", value:'%%%ref%%%'},
{type: "settings", position: "label-left", labelWidth: 150, inputWidth: 390},

{type: "fieldset",  name: "informations", label: "Informations", width:600, list:[

    {
      type: "calendar",
      label: "Echéance interne",
      value: '%%%d_interne%%%',
      name:"d_interne",
      dateFormat: "%Y-%m-%d", 
      labelWidth: 340, inputWidth: 200,
    },
    {
      type: "calendar",
      label: "Echéance bon de commande",
      value: '%%%d_bdc%%%',
      name:"d_bdc",
      dateFormat: "%Y-%m-%d", 
      labelWidth: 340, inputWidth: 200,
    },
    {
      type: "calendar",
      label: "Echéance compta",
      value: '%%%d_compta%%%',
      name:"d_compta",
      dateFormat: "%Y-%m-%d", 
      labelWidth: 340, inputWidth: 200,
    },
    {
      type: "combo", 
      label: "Statut", 
      name: "statut",  
      required: true,
      validate:"ValidNumeric",
      options:[{value: "%%%id_statut%%%", text: "%%%id_statut_text%%%"}],
      inputWidth: 390,
    },	

    {
      type: "editor",
      label: "Notes",
      value: '%%%notes%%%',
      name:"notes",
      inputHeight: 300,
    },
]},

{type: "newcolumn"},

{type: "fieldset",  name: "envoifacture", label: "Envoi de la facture", width:600, list:[
    {
      type: "calendar",
      label: "Date",
      value: '%%%envoi_d%%%',
      name:"envoi_d",
      dateFormat: "%Y-%m-%d", 
      labelWidth: 340, inputWidth: 200,
    },
    {
      type: "editor",
      label: "Notes",
      value: '%%%envoi_notes%%%',
      name:"envoi_notes",
      inputHeight: 100,
    },
]},

{type: "fieldset",  name: "facturerecu", label: "Facture reçue", width:600, list:[
    {
      type: "calendar",
      label: "Date",
      value: '%%%recu_d%%%',
      name:"recu_d",
      dateFormat: "%Y-%m-%d", 
      labelWidth: 340, inputWidth: 200,
    },
    {
      type: "editor",
      label: "Notes",
      value: '%%%recu_notes%%%',
      name:"recu_notes",
      inputHeight: 100,
    },
]},

{type: "fieldset",  name: "miseenreglement", label: "Mise en réglement", width:600, list:[
    {
      type: "calendar",
      label: "Date",
      value: '%%%regle_d%%%',
      name:"regle_d",
      dateFormat: "%Y-%m-%d", 
      labelWidth: 340, inputWidth: 200,
    },
    {
      type: "editor",
      label: "Notes",
      value: '%%%regle_notes%%%',
      name:"regle_notes",
      inputHeight: 100,
    },
]},

			
];	

	        
					        
formBudget = new dhtmlXForm("formBudget");
formBudget.loadStruct(formBudgetData, function(){
	formBudget.setItemFocus('d_interne');
	window.location = "#top";
});

formBudget.getCombo("statut").load("index_X.pl?liste=xmlInvoiceListe&champ=statut");

Hi
You can try to use method setFocusOnFirstActive - it moves the focus on the first form’s element

Hi,

I tried with

formBudget.setItemFocus('d_interne');

And the refocus on last editor append AFTER the form loaded event

Just tried with setFocusOnFirstActive
the same append

In this case please attach completed demo to inspect it.
docs.dhtmlx.com/doku.php?id=othe … leted_demo

Wrong link :slight_smile:
http://docs.dhtmlx.com/auxiliary_docs__demo_for_support.html

Here’s the test pack
editorfail.zip (424 KB)

And a screenshoot :


Note it happend on FF 30, not under Chrome 35

Hi

thanks for demo. please try attached updates
dhtmlx_updated.zip (258 KB)

Works SUPER fine ! (under FF)
Will it be included in the next release ?

:slight_smile: thanks

yes, will included into nearest bugfix 4.0.3