[Column selection]
.SelectionSettings(selection => selection.SelectionMode(mode => { mode.AddMode(SelectionMode.Row);
mode.AddMode(SelectionMode.Column);})))
.ClientSideEvents(eve => { eve.ColumnSelected("ColumnSelected")})//column selected event is trigger when column selection is enabled
[cellSelection]
.SelectionSettings(selection => selection.SelectionMode(mode => { mode.AddMode(SelectionMode.Row);
mode.AddMode(SelectionMode.Column);}))).ClientSideEvents(eve =>{eve.CellSelected("cellSelected");})//cellSelected event is trigger when cell selection is enabled
[RowSlection]
ClientSideEvents(eve =>{eve.RowSelected("RowSelected");})//by default rowselection is enabled
|
. . .
.ClientSideEvents(eve => { eve.ColumnSelected("ColumnSelected");
eve.CellSelected("cellSelected");
})
.SelectionSettings(selection => selection.SelectionMode(mode => { mode.AddMode(SelectionMode.Row);
mode.AddMode(SelectionMode.Column);})))
. . .
<script>
$("#cell").ejButton({
click: function () {
//enable column and cell selection dynamically
$("#FlatGrid").ejGrid({ selectionSettings: { selectionMode: ["cell","column" ] } });
}
});
. . .
</script>
|
function ColumnSelected(arg) {
$("#red").text( "col: " + arg.columnIndex);
}
function OnRowSelected(arg)
{
$("#red").text("row: " + arg.rowIndex );
}
function cellSelected(args)
{
$("#red").text("columnIndex :" + args.cellIndex + "RowIndex :"+ args.selectedRowCellIndex[0].rowIndex );
} |
//Both Highlighted word should same.
@(Html.EJ().Grid<Person>("FlatGrid")
. . .
//Enable row and column selection
.SelectionSettings(s =>
s.SelectionMode(m =>
{
m.AddMode(SelectionMode.Column);
m.AddMode(SelectionMode.Row);
}
))
.ClientSideEvents(eve => { eve.RowSelected("OnRowSelected").ColumnSelected("OnColumnSelected"); }) )
function OnRowSelected(arg) {
$("#red").text("row: " + arg.RowSelected);
}
function OnColumnSelected(args) {
//To do your functionality
} |
@(Html.EJ().Grid<Person>("FlatGrid")
//If you used two different name for the same event then the first name will overwrite by the second name of the event
.ClientSideEvents(evt => evt.RowSelected("OnRowSelected"))
. . .
.ClientSideEvents(eve => { eve.RowSelected("RowSelected"); })
)
|
@(Html.EJ().Grid<Person>(“FlatGrid”)
. . .
//Enable row and column selection
.SelectionSettings(s =>
s.SelectionMode(m =>
{
m.AddMode(SelectionMode.Column);
m.AddMode(SelectionMode.Row);
}
))
) |