Jun 10, 2014, 7:21 PM
[CLOSED] Grid panel selected row cout check-MVC
I have a grid panel
live example here
http://legalinfoservices.com/home
Purchase Management->Master Management->Material Category
<script>
Ext.onReady(function () {
// Ext.getCmp("btnEdit").setDisabled(true);
});
/* A header Checkbox of CheckboxSelectionModel deals with the current page only.
This override demonstrates how to take into account all the pages.
It works with local paging only. It is not going to work with remote paging.
*/
Ext.selection.CheckboxModel.override({
selectAll: function (suppressEvent) {
var me = this,
selections = me.store.getAllRange(), // instead of the getRange call
i = 0,
len = selections.length,
start = me.getSelection().length;
me.suspendChanges();
for (; i < len; i++) {
me.doSelect(selections[i], true, suppressEvent);
}
me.resumeChanges();
if (!suppressEvent) {
me.maybeFireSelectionChange(me.getSelection().length !== start);
}
},
deselectAll: Ext.Function.createSequence(Ext.selection.CheckboxModel.prototype.deselectAll, function () {
this.view.panel.getSelectionMemory().clearMemory();
}),
});
</script>
Html.X().GridPanel()
.ID("GridPanel1")
.Title("Tasks")
.Frame(true)
.Layout("fit")
.Store(
Html.X().Store()
.ID("Store1")
.Model(
Html.X().Model()
.IDProperty("MaterialCatergoryID")
.Fields(
Html.X().ModelField().Name("IsActive").Type(ModelFieldType.Boolean),
Html.X().ModelField().Name("CategoryName").Type(ModelFieldType.String)
)
)
.DataSource(ViewBag.loadgrid)
.PageSize(10)
)
.ColumnModel(
Html.X().Column()
.DataIndex("IsActive")
.Text("IsActive")
.Flex(1),
Html.X().Column()
.DataIndex("CategoryName")
.Text("CategoryName")
.Flex(1)
)
.SelectionModel(
X.CheckboxSelectionModel()
.ID("s")
.Mode(SelectionMode.Multi)
)
.Plugins(
Html.X().CellEditing()
)
.BottomBar(
Html.X().PagingToolbar()
.HideRefresh(true)
)
.TopBar(
Html.X().Toolbar()
.Items(
Html.X().TextField()
.ID("txtSearch")
.EmptyText("Search by Module name")
.DirectEvents(de =>
{
de.Change.Action = "/search";
de.Change.ExtraParams.Add(new Parameter
{
Name = "data",
Value = "Ext.getCmp('txtSearch').getValue()",
Mode = ParameterMode.Value,
Encode = false
}
);
})
,
How do i do?If only one row is selected then only edit button is enable other wise the button is disable.live example here
http://legalinfoservices.com/home
Purchase Management->Master Management->Material Category
Last edited by Daniil; Jun 17, 2014 at 11:41 AM.
Reason: [CLOSED]