PDA

View Full Version : How to change 'Loading...' message ?



Lord Vader
29 May 2007, 10:53 AM
Hello, this's my first post, so Hi for everyone :)

My code:


form_sub.submit({params:{action:'submit'}, waitMsg:'Saving data'});

During saving data I want to change standard 'Saving data' to this on page: http://extjs.com/deploy/ext/docs/index.html
Is any possibility to do that?

Also, I would like to show something div with text: "OK" if everythings is ok or "ERROR" if something goes wrong..

THANKS AWFULLY!

tryanDLS
29 May 2007, 11:42 AM
You can specify whatever text you want. If you want to mask a different element, use the waitMsgTarget config option.

You can add handlers for actioncomplete and actionfailed to do post-submit functions.

Lord Vader
29 May 2007, 12:13 PM
You can specify whatever text you want. If you want to mask a different element, use the waitMsgTarget config option.
Where is description of this option?


You can add handlers for actioncomplete and actionfailed to do post-submit functions.
I know, but how do it? :)

tryanDLS
29 May 2007, 12:52 PM
Please read the doc (http://extjs.com/deploy/ext/docs/output/Ext.form.Form.html#waitMsgTarget)

See the xml form example for how to add an action handler.

Lord Vader
29 May 2007, 11:57 PM
Maybe tiny example? :)

cocorossello
30 May 2007, 12:15 AM
There are some examples in this forums, just search a bit more ;)



form.submit({
waitMsg: 'someMessage',
success: function(f,e){alert('ok');},
invalid: function(f,e) {alert('invalid');}
failure: function(f,e){alert('error');}
});

Lord Vader
30 May 2007, 1:03 AM
I found information about handlers.. the thing is that, I want to set mask or something to change 'standard loader' to this on page: http://extjs.com/deploy/ext/docs/index.html

but thanks for replay cocorossello :)

tryanDLS
30 May 2007, 7:11 AM
If you want to do what the index page does, view source and look at the code - it's all there.

Lord Vader
30 May 2007, 10:57 AM
ok.. I solved the problem, thanks :)

I have one more question.. How to refresh updating data in form and how to set default language package (ext-lang-....) ?

willydee
30 May 2007, 12:52 PM
At least the second part is easy to answer: just include in your page:


<script type="text/javascript" src="/path/to/ext/source/locale/ext-lang-xy.js"></script>

willydee
30 May 2007, 1:10 PM
Updating form content is also rather easy: get some JSON data matching your form elements, and load it.



Ext.onReady(function() {
var myJson = '{"field1":"Content of field 1","field2":"Content of field 2"}';
var myForm = new Ext.form.Form();
myForm.add(new Ext.form.TextField({ fieldLabel: 'Field 1', name: 'field1', width: 200 }));
myForm.add(new Ext.form.TextField({ fieldLabel: 'Field 2', name: 'field2', width: 200 }));
myForm.render('form-div');
myForm.setValues(Ext.decode(myJson));
});


Of course, you might want to use the action functionality offered by the form class, but that was described a few times here.

Lord Vader
30 May 2007, 2:11 PM
thank you all...