简体   繁体   中英

how i set loading on save button extjs4?

Hi i have save button and submit form, when i click show loading icon when form are not submitted. Please help me, in extjs 4.

buttons:[{ 
   text: save,
   handler: function(){ 
      form.submit({ 
          /sucess or failure code here; 
      }) 
   }
}]
  • First you need a gif file for "waiting icon" with appropriate size.
  • Then you create a css class for your "Save" button in waiting status. For example:
.save-waiting {
    background-image: url("url-to-your-waiting-gif-file");
}
  • Finally toggle the Save button to include this class when submitting form with:
saveButton.addCls('save-waiting');
    // may disable the save button here

After successful response of submission, you remove the "waiting status" on the button or something else

saveButton.removeCls('save-waiting');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM