注: "afterRequest関数内の別のクラスBでClassA関数" deleteEntryInternal "を呼び出す必要があります。extjs4の異なるクラスB関数でクラスAから関数を呼び出す方法
私のコードはここに //下にあるが、私のクラスは、このメソッドを呼び出すには
Ext.define('WebCare.UI.OtherServicesEditor', {
extend: 'Ext.WebCare.UI.BaseEditor',
_otherservicesGrid: null,
alias: 'widget.otherserviceseditor',
title: 'Other Services',
defaultType: 'textfield',
id: 'otherservicesEditor',
deleteEntryInternal: function (isDelete) {
this.disableForm();
var self = this;
var selection = self._otherservicesGrid.getSelectionModel().getSelection();
if (selection.length > 0) {
if (isDelete) {
selection[0].data.IsDelete = true;
}
this.deleteServerRecord(selection[0].data, function() { });
vent.trigger(otherServicesStore.storeId, selection[0].data);
}
}
関数が静的でない限り、クラスの関数を呼び出すことはできません。クラスインスタンス上でのみ関数を呼び出すことができます。そのためには、インスタンス( 'var instanceA = Ext.create( 'A'); instanceA.deleteEntryInternal()')が必要です。 – Alexander
返信ありがとう!!! – Hemant
[mixins](http://docs.sencha.com/extjs/4.2.6/#!/api/Ext.Class-cfg-mixins)はどうですか? – scebotari66