- Home
- Forum
- ASP.NET Web Forms
- ACTION OF CUSTOMIZATION TOOLBAR
ACTION OF CUSTOMIZATION TOOLBAR
Hello
I need to example of a action of to button of customization toolbar in the moment that select to row.
SIGN IN To post a reply.
1 Reply
VN
Vignesh Natarajan
Syncfusion Team
March 22, 2019 06:47 AM UTC
Hi Guadalupe,
Thank for contacting Syncfusion support.
Query: ACTION OF CUSTOMIZATION TOOLBAR
We have achieved your requirement using custom toolbar feature of ejGrid. And using toolbarClick event we have changed the alignment of selected tr.
Please refer the below code example,
|
<ej:Grid ID="OrdersGrid" runat="server" AllowPaging="True">
<ClientSideEvents ToolbarClick="onToolBarClick" />
…………………..
<ToolbarSettings ShowToolbar="True">
<CustomToolbarItem>
<ej:CustomToolbarItem Text="left" />
<ej:CustomToolbarItem Text="center" />
<ej:CustomToolbarItem Text="right" />
</CustomToolbarItem>
</ToolbarSettings>
<Columns>
……………………………
</ej:Grid>
<script type="text/javascript">
function onToolBarClick(sender) {
var gridObj = $("#<%= OrdersGrid.ClientID %>").data("ejGrid");
var rowIndex = gridObj.model.selectedRowIndex;
var tr = gridObj.getRows()[rowIndex];
if (sender.itemName == "left")
$(tr).find('td').css('cssText', 'text-align: left !important');
else if (sender.itemName == "center")
$(tr).find('td').css('cssText', 'text-align: center !important');
else
$(tr).find('td').css('cssText', 'text-align: right !important');
}
</script>
<style type="text/css" class="cssStyles">
.left {
background-image: url("../Content/left.png");
background-size: 20px 20px;
}
.center {
background-image: url("../Content/center.png");
background-size: 20px 20px;
}
.right {
background-image: url("../Content/right.png");
background-size: 20px 20px;
}
</style>
</asp:Content> |
Refer the below link for sample,
Also refer the below link for help documentation and demo,
Please get back to us if you have further queries.
Regards,
Vignesh Natarajan.
SIGN IN To post a reply.
- 1 Reply
- 2 Participants
-
GU Guadalupe
- Mar 21, 2019 09:43 PM UTC
- Mar 22, 2019 06:47 AM UTC