javascript - Change cursor style while processing Ext.Button handler -
using extjs 4, have ext.button handler function takes while run. while runs, button looks it's pressed , cursor keeps looking pointer hand.
i'd change cursor style appear waiting (i.e. css style wait). sample code need change:
function myhandler(button) { //1. todo: change cursor wait processingstuff(); // might take 10 seconds //2. todo: change cursor default }; ext.application({ name: 'ext.array.clean()', launch: function () { ext.create('ext.button', { text : 'my button', renderto: ext.getbody(), handler : myhandler }); } // launch }); // ext.application() update:
thank you, hopper , lauren, missing piece needed delay before running processingstuff() method explained here: extjs load mask while long processing
here sample based on lauren's fiddle: http://jsfiddle.net/wbmsw/
the above sample not work in ie , i'm not sure why, guess hover event on button not triggered in time, solution think of using mask or use setloading() lauren suggested: http://jsfiddle.net/g9tqx/6/ (i can't use web workers because not supported in ie8)
you can disable button, button.setdisabled(true), gets class x-item-disabled(by default) can style in css. see: http://jsfiddle.net/xgx5x/
you can use button.setloading(true).
Comments
Post a Comment