The engineering uses Sencha ExtJs, because of the specific component reason that causes many components to be themselves. The success_callback after the component definition has been completed because it has not been done before, so write it down for later review. Directly on the code:
Interface call
The code is as follows |
Copy Code |
<script type= "Text/javascript" > function aaa () { var student_panel = new WX.student.AddStudent ({ Incoming callback function, shown directly. Callback_fun:function () { Alert (' I am the callback function for the interface '); } ). Show (); } </script> |
Component Part Code
The code is as follows |
Copy Code |
Ext.define (' WX.student.AddStudent ', { Extend: ' Ext.window.Window ', Modal:true, height:585, width:684, Layout: { Type: ' Fit ' }, Title: ' New Students ', Bodypadding: ' 10 10 10 10 ', For component function callbacks Callback_fun:function () {}, Initcomponent:function () { var me = this; ...... Panel component buttons:[{ Text: ' Save ', Handler:function () { Send AJAX requests to save user data. Custom callback function after call to store This.callback_fun } }] } |
..... Here the approach is similar to Java interface callback, in the custom module to define methods, provide button callback, interface initialization component in the method to overwrite the callback method in the component, to achieve the purpose of the callback.
All right, about ExtJS. Custom Component function Callback here, if you don't understand, you can refer to other articles.