PDA

View Full Version : [CLOSED] Cellediting BeforeEdit not firing



matrixwebtech
Jul 10, 2014, 6:45 PM
This is my one editor column inside grid panel


X.Column()
.DataIndex("stateid")
.Text("State")
.Renderer("stateRenderer")

.Editor(X.ComboBox()
.ID("ddlstate")
.QueryMode(DataLoadMode.Remote)
.TriggerAction(TriggerAction.All)
.StoreID("StateStore")
.ValueField("stateid")
.DisplayField("state")
.CustomConfig(cc => cc.Add(new ConfigItem { Name = "initQuery", Value = "Ext.emptyFn", Mode = ParameterMode.Raw }))
)

I fill this using bellow store


@(X.Store()
.ID("CityStore")
.Model(X.Model()
.IDProperty("cityid")
.Fields(
X.ModelField()
.Name("cityid")
.Mapping("cityid")
.Type(ModelFieldType.String)
,
X.ModelField()
.Name("city")
.Mapping("city")
.Type(ModelFieldType.String)
)
)
.DataSource(Model[2])
//.Proxy(X.AjaxProxy()
// .Url(Url.Action("GetCities"))
// .Reader(X.JsonReader().Root("data"))
//)
)


var beforeEdit = function (ed, e) {
var field = this.getEditor(e.record, e.column).field;
console.log(field)
switch (e.field) {

case "stateid":
console.log(e.field)
field.allQuery = e.record.get('countryid');

break;
case "cityid":
field.allQuery = e.record.get('stateid');
break;



}
};
Cellediting->lisners-> BeforeEdit not working if I comment out this Proxy part,or I use Serverproxy instead of Proxy.is there any way to fire this BeforeEdit function without use Proxy?If I not use DataSource then the combox inside grid not showing data.and If i use Proxy the also presence of DataSource property combo data is disappear.I am facing this problem.please help me to relosve this.

matrixwebtech
Jul 11, 2014, 3:05 PM
this thread can be close I setup my stores like


@(X.Store()
.ID("StateStore")
.Model(X.Model()
.IDProperty("stateid")
.Fields(
X.ModelField()
.Name("stateid")
.Mapping("stateid")
.Type(ModelFieldType.String)
,
X.ModelField()
.Name("state")
.Mapping("state")
.Type(ModelFieldType.String)
)

)
.Data(Model[1])

.Proxy(
X.AjaxProxy()
.Url(Url.Action("GetStates"))
.Reader(
X.JsonReader().Root("data")
)

)

)