Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
150810 | Jan 21,2020 03:55 AM UTC | Jan 23,2020 01:28 PM UTC | ASP.NET Core - EJ 2 | 3 |
![]() |
Tags: DataGrid |
<ejs-grid id="Grid" dataSource="@ViewBag.DataSource" queryCellInfo="template" toolbar="@(new List<string>() { "Add", "Edit", "Delete", "Cancel", "Update" })">
<e-grid-editSettings allowAdding="true" allowDeleting="true" allowEditing="true" mode="Dialog"></e-grid-editSettings>
<e-grid-columns>
. . . . . . .
<e-grid-column headerText="Dropdown Button" template="#columnTemplate" width="150"></e-grid-column>
. . . . . . .
</e-grid-columns>
</ejs-grid>
<script type="text/x-jsrender" id="columnTemplate">
<button class="List">Ações</button>
</script>
<script type="text/javascript">
var data = [
{ text: "Visualizar", iconCss: "fa fa-eye" },
{ text: "Editar", iconCss: "fa fa-edit" },
{ text: "Excluir", iconCss: "fa fa-trash" },
{ text: "Liberar p/ Gerência", iconCss: "fa fa-user" },
{ text: "Baixar", iconCss: "fa fa-check" },
{ text: "Estornar", iconCss: "fa fa-mail-reply" },
{ text: "Pagto Parcelado", iconCss: "fa fa-list-ol" }
];
function template(args) {
var ele = args.cell.querySelector('.List');
var drop = new ej.splitbuttons.DropDownButton({
popupHeight: 150,
popupWidth: 200,
items: data
});
drop.appendTo(ele);
}
</script>
|
var flag = true;
var dialogObj;
function dataBound(args) {
if (flag) {
dialogObj = new ej.popups.Dialog({
showCloseIcon: true,
target: document.getElementById('e-content'),
. . . .
visible: false,
header: 'Trip Details',
content: '<div id="Grid2"></div>',
created: function (args) {
var grid = new ej.grids.Grid({
dataSource: data1,
});
grid.appendTo('#Grid2');
}
});
dialogObj.appendTo('#wrapper');
flag = false;
}
}
var data1 = @Html.Raw(Json.Serialize(ViewBag.DataSource));
function template(args) {
var ele = args.cell.querySelector('.List');
var drop = new ej.splitbuttons.DropDownButton({
popupHeight: 150,
popupWidth: 200,
items: data,
select: function (args) {
dialogObj.show();
}
});
drop.appendTo(ele);
} |
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.