Apr 16, 2014, 12:39 PM
[CLOSED] Grid Panel - CellSelectionModel with RowEditing Plugin
Hi
I am trying to mix 2 things here... I want to implement the row editing plugin.
But I want user to navigate within cells while in view mode (non-edit). So I have merged the rowediting with cell selection model.
But now, while I am editing a row, I am able to select cells from non-editable rows.
Screenshot attached.
How can I stop cell selection during row editing mode?
Code given
I am trying to mix 2 things here... I want to implement the row editing plugin.
But I want user to navigate within cells while in view mode (non-edit). So I have merged the rowediting with cell selection model.
But now, while I am editing a row, I am able to select cells from non-editable rows.
Screenshot attached.
How can I stop cell selection during row editing mode?
Code given
Html.X().GridPanel()
.Cls("channel4-custom-grid grid-border-highlighted")
.Border(true)
.ColumnLines(true)
.RowLines(true)
.ID("myGrid")
//.Height(400)
.Width(500)
.Store(
Html.X().StoreForModel().PageSize(5).Control(s =>
{
s.AutoSync = true;
s.Proxy.Add(
new RestProxy
{
AppendAction = false,
Reader = {
new JsonReader {
Root = "data",
MessageProperty = "message"
}
},
API =
{
Read = Url.Action("Read"),
Update = Url.Action("Update"),
Create = Url.Action("Create"),
Destroy = Url.Action("Destroy")
},
Writer = {
new JsonWriter
{
AllowSingle = true
}
}
}
);
s.Listeners.Write.Fn = "onWrite";
})
)
.ColumnModel(
Html.X().Column().Width(20).TdCls("first-row"),
Html.X()
.ColumnFor(Model, m => m.Id)
.ToBuilder<Column.Builder>()
.Width(40),
Html.X().ColumnFor(Model, m => m.Email)
.ToBuilder<Column.Builder>()
.Flex(1)
.Editor(
Html.X().TextField().AllowBlank(false).StandardVtype(ValidationType.Email).SelectOnFocus(true)
.Listeners(l=>
{
l.SpecialKey.Fn = "preventShiftTab";
})
),
Html.X().ColumnFor(Model, m => m.First)
.ToBuilder<Column.Builder>()
.Flex(1)
.Editor(
Html.X().TextField().AllowBlank(false).SelectOnFocus(true).Disabled(true)
),
Html.X().ColumnFor(Model, m => m.Last)
.ToBuilder<Column.Builder>()
.Flex(1)
.Editor(
Html.X().TextField().AllowBlank(false).SelectOnFocus(true)
.Listeners(l=>
{
l.SpecialKey.Fn = "preventTab";
})
)
)
.SelectionModel(Html.X().CellSelectionModel())
.BottomBar(
Html.X().PagingToolbar())
.Plugins(
Html.X().RowEditing().AutoCancel(false)
.Listeners(l => {
l.CancelEdit.Handler = "if(e.record.phantom){e.store.remove(e.record);}";
l.ValidateEdit.Handler = "v";
})
)
Last edited by Daniil; May 06, 2014 at 6:54 AM.
Reason: [CLOSED]