May 22, 2014, 7:01 AM
[CLOSED] problem layout grid panel group after edit cell
Good morning
I have a problem with grid panel group.
when I edit a cell, I lose the layout of the grouping as in the attached image.
how can I solve my problem?
This is an example of my code.
M.
I have a problem with grid panel group.
when I edit a cell, I lose the layout of the grouping as in the attached image.
how can I solve my problem?
This is an example of my code.
@using Ext.Net;
@using Ext.Net.MVC;
@model List<It.Alterna.EBilling.Models.VRIGHE_PDO_GIORNIModel>
@{
ViewBag.Title = "Elior - EBilling - PDOs ";
Layout = "~/Views/Shared/_Layout.cshtml";
var X = Html.X();
}
@section headtag
{
<script>
var prepareGroupToolbar = function (grid, toolbar, groupId, records) {
// you can prepare ready toolbar
};
var onGroupCommand = function (column, command, group) {
if (command === 'SelectGroup') {
column.grid.getSelectionModel().select(group.children, true);
return;
}
Ext.Msg.alert(command, 'Group name: ' + group.name + '<br/>Count - ' + group.children.length);
};
var getAdditionalData = function (data, idx, record, orig) {
return {
rowBodyColspan: record.fields.getCount(),
rowBody: Ext.String.format('<div style=\'padding:0 5px 5px 5px;\'>The {0} [{1}] requires light conditions of <i>{2}</i>.<br /><b>Price: {3}</b></div>', data.Common, data.Botanical, data.Light, Ext.util.Format.usMoney(data.Price))
};
};
var edit = function (editor, e) {
/*
"e" is an edit event with the following properties:
grid - The grid
record - The record that was edited
field - The field name that was edited
value - The value being set
originalValue - The original value for the field, before the edit.
row - The grid table row
column - The grid Column defining the column that was edited.
rowIdx - The row index that was edited
colIdx - The column index that was edited
*/
// Call DirectMethod
if (!(e.value === e.originalValue || (Ext.isDate(e.value) && Ext.Date.isEqual(e.value, e.originalValue)))) {
Ext.net.DirectMethod.request({
url: '@(Url.Action("Update"))',
params: {
pk : e.record.data.pk,
totale : e.record.data.TOTALE,
cod_pdo: e.record.data.COD_PDO,
art: e.record.data.ART,
field: e.field,
oldValue: e.originalValue,
newValue: e.value,
customer: e.record.data
}
});
}
};
</script>
}
@section container
{
@(Html.X().GridPanel()
.ID("gridPDO")
//.Frame(true)
.Collapsible(true)
.ForceFit(true)
.TopBar(Html.X().Toolbar()
.Items(Html.X().LinkButton()
.Text(ViewBag.Mese)
.CtCls("topbarMonth")
)
)
.Store(Html.X().Store()
//.ShowWarningOnFailure(false)
.ID("storePdos")
.DataSource(Model)
//.AutoSync(true)
.GroupField("COD_PDO")
.Model(Html.X().Model()
.IDProperty("pk")
.Fields(
new ModelField("pk"),
new ModelField("COD_PDO"),
new ModelField("ART"),
new ModelField("PREZZO"),
new ModelField("C1", ModelFieldType.Int),
new ModelField("C1", ModelFieldType.Int),
new ModelField("C2", ModelFieldType.Int),
new ModelField("C3", ModelFieldType.Int),
new ModelField("C4", ModelFieldType.Int),
new ModelField("C5", ModelFieldType.Int),
new ModelField("C6", ModelFieldType.Int),
new ModelField("C7", ModelFieldType.Int)
)
)
)
.ColumnModel(
Html.X().Column()
.Text("ART")
.DataIndex("ART")
.Flex(1),
Html.X().Column()
.Text("PREZZO ?")
.DataIndex("PREZZO")
.Flex(1)
.Align(Alignment.Right)
.Renderer(RendererFormat.EuroMoney)
,
Html.X().Column()
.Text("1")
.DataIndex("C1")
.Flex(1)
.Align(Alignment.Right)
.Editor(Html.X().NumberField().Step(1).MinValue(0).AllowBlank(true))
,
Html.X().Column()
.Text("2")
.DataIndex("C2")
.Align(Alignment.Right)
.Editor(Html.X().NumberField().Step(1).MinValue(0).AllowBlank(true))
.Flex(1),
Html.X().Column()
.Text("3")
.DataIndex("C3")
.Align(Alignment.Right)
.Editor(Html.X().NumberField().Step(1).MinValue(0).AllowBlank(true))
.Flex(1),
Html.X().Column()
.Text("4")
.DataIndex("C4")
.Align(Alignment.Right)
.Editor(Html.X().NumberField().Step(1).MinValue(0).AllowBlank(true))
.Flex(1),
Html.X().Column()
.Text("5")
.DataIndex("C5")
.Align(Alignment.Right)
.Editor(Html.X().NumberField().Step(1).MinValue(0).AllowBlank(true))
.Flex(1),
Html.X().Column()
.Text("6")
.DataIndex("C6")
.Align(Alignment.Right)
.Editor(Html.X().NumberField().Step(1).MinValue(0).AllowBlank(true))
.Flex(1),
Html.X().Column()
.Text("7")
.DataIndex("C7")
.Flex(1)
.Align(Alignment.Right)
.Editor(Html.X().NumberField().Step(1).MinValue(0).AllowBlank(true))
Html.X().CommandColumn()
.Hidden(true)
.GroupCommands(
Html.X().CommandFill(),
Html.X().GridCommand()
.CommandName("TRASMETTIPDO")
.Text("TRASMETTI PDO")
.StandOut(true)
)
.Listeners(ls =>
ls.GroupCommand.Fn = "onGroupCommand"
)
)
.Features(
Html.X().Grouping()
.HideGroupedHeader(false),
Html.X().RowWrap()
)
.Plugins(
Html.X().CellEditing().Listeners(ls => ls.Edit.Fn = "edit")
)
)
}
Thank youM.
Last edited by Daniil; May 28, 2014 at 4:30 AM.
Reason: [CLOSED]