BoldDeskWe are launching BoldDesk on Product Hunt soon. Learn more & follow us.
Hi Jesus
Thanks for using Syncfusion Products.
We have analyzed the sample that you have provided. We are
unable to reproduce the crash issue that you have mentioned. But we found two
other issues with the sample. “Misalignment
in grid content when enabling .AllowSummary() and .GroupedColumnShow(false)
properties in the grid” and “Issue in toolbar when grid is rendered in
partialview”.
The screenshots corresponding to the above issues can be
downloaded from the attachment.
We have logged defect report on the above issues. The fix
for the issues will be available in our Volume 2, 2014 release at the mid of
June month.
Please let us know if you need any further assistance.
Regards
Ragavee U S
Hi Jesus
Based on your requirement, we have created a sample and the
same can be downloaded from the following location:
Sample Link: : http://www.syncfusion.com/downloads/support/directtrac/124484/Sample124484651546245.zip
In the sample above, we have updated the div using AJAX
call to the controller. Please refer the below code snippet:
[In
index.cshtml] <script type="text/javascript"> $(document).ready(function () {
$("#linkBtn").click(function () {
$.ajax
({
url: "Home/Productpartial",
type: 'GET',
success: function
(data)
{
$("#divProduct").html(data);
},
error: function
(error) {
alert(eval(error))
}
});
});
}); </script>
[In Controller]
public ActionResult Productpartial()
{
var
DataSource = new NorthwindDataContext().OrdersViews.ToList();
ViewData["datasource"] = DataSource;
return
PartialView("_productpartial", ViewData);
} |
Please let us know if you need any further assistance.
Regards
Ragavee U S
Hi Jesus
We have analyzed the sample that you have provided.
Everytime the refresh button is clicked the Home/Productpartial url is invoked. Since the same dataSource is bound to the grid in the
success event of the AJAX call as in the code snippet below, you are
unable to view the refreshing event of the grid.
public ActionResult Index()
{
var DataSource = new NorthwindDataContext().OrdersViews.ToList();
ViewData["datasource"] = DataSource;
return
View();
}
public
ActionResult Productpartial()
{
var
DataSource = new NorthwindDataContext().OrdersViews.ToList();
ViewData["datasource"]
= DataSource;
return
PartialView("_productpartial", ViewData);
} |
We have attached the screenshot for the request passed
second time, the refresh button is clicked. Please find the screenshot in the
attachment.
Please let us know if you need any further assistance.
Regards
Ragavee U S
Hi,
I have a break point in the function:
public ActionResult Productpartial()
{
....
}
and for the first time only????????. I don´t Know???
I've fixed it in the following way:
In the jquery:
$("#btnRefresh").on("click", function (e) { .... }
instead of
$("#btnRefresh").click(function () { ... }
var gridObj = $find('VGastosGrid');
var selectRow = gridObj.selectedRows();
if (selectRow != "") {
var id = selectRow[0].cells[1].innerHTML;
// do something
}
Hi Jesus
We have analyzed your requirement.
We have considered that you are asking for ASP.NET
MVC code and thus have provided the equivalent ASP.NET MVC code snippet for the one which you
have provided.
Please refer the below code
snippet:
<script type="text/javascript">
function
selected(args){
var
gridObj = $("#Grid").data("ejGrid"); var selectRow =
gridObj.getSelectedRecords();
if
(selectRow != "")
var id =
selectRow[0].OrderID; //do something
} </script> |
Please get back to us if you
require the code in ASP.NET MVC Classic
and let us know if you need any further
assistance.
Regards
Ragavee U S
Thanks!!!
Hi Jesus
The ASP.Net MVC Controls used in Essential Studio
v11.4.0.26, is now renamed as ASP.Net MVC (Classic) and the newer set of
controls powered by Essential JavaScript takes its place.
In the ASP.Net MVC (latest), we don’t have separate DLL for
every controls rather we will use “Syncfusion.EJ.MVC.dll” and
“Syncfusion.EJ.dll” to hold all the controls in common. And in the ASP.Net
MVC (classic), we have separate DLLs for individual controls.
Please refer the below Release note of Essential Studio
v12.1.0.43.
https://s3.amazonaws.com/files2.syncfusion.com/Installs/v12.1.0.43/ReleaseNotes/ASPMVCClassic.html
Could you please tell us know whether you want to use the
ASP.Net MVC or ASP.Net MVC(Classic) ?
The Grid control for ASP.NET MVC Classic is
initialized as follows:
@(Html.Syncfusion().Grid<object>
Whereas in current ASP.NET MVC,
the grid control is initialized as:
@(Html.EJ().Grid<object>
The provided information will be
helpful for us in providing you response accordingly.
In ASP.NET MVC, the grid
content can be refreshed using the dataSource() method. Please refer the
below code snippet:
<script> . . . var obj = $("#Grid").data("ejGrid"); obj.dataSource(data);//data - data obtained from controller </script> |
Please let us know if you need any
further assistance.
Regards
Ragavee U S
My script in the view:
$('#Delete').on("click", function (e) {
var gridObj = $("#TaxisGrid").data("ejGrid");
var selectRow = gridObj.getSelectedRecords();
if (selectRow != "") {
msgBoxImagePath = "../../images/";
$.msgBox({
title: "Atención",
content: "Estás seguro de eliminar el Registro seleccionado?",
type: "confirm",
buttons: [{ value: "Si" }, { value: "No" }, { value: "Cancelar"}],
success: function (result) {
if (result == "Si") {
var id = selectRow[0].Id;
var url = "/Taxis/DeleteTaxi?id=" + id;
event.preventDefault();
$.ajax({
url: url,
dataType: 'json'
}).done(function (response) {
if (response.success) {
var obj = $("#TaxisGrid").data("ejGrid");
//obj.dataSource(Model); -> I WANT UPDATE THE GRID!!!! HOW????
//gridObj.refreshGridContent(true);
}
});
}
}
});
} else {
msgBoxImagePath = "../../images/";
$.msgBox({
title: "Atención",
content: "Debes seleccionar un registro para poder Borrarlo",
type: "alert"
});
}
});
My controller:
[HttpGet]
public ActionResult DeleteTaxi(int id)
{
ManagementDB.DeleteTaxi(id);
//return (ManagementDB.GetAllTaxi(User.Identity.Name).GridActions<Taxi>());
return Json(new { success = true }, JsonRequestBehavior.AllowGet);
}
///////////////////
Before with ASP.net mvc classic I do this:
$('#Delete').live("click", function (e) {
var gridObj = $find('VGastosGrid');
var selectRow = gridObj.selectedRows();
if (selectRow != "") {
$.msgbox("Estás seguro de eliminar el Registro seleccionado?", {
type: "confirm",
buttons: [
{ type: "submit", value: "Si" },
{ type: "submit", value: "No" },
{ type: "cancel", value: "Cancelar" }
]
function (result) {
if (result == "Si") {
var id = selectRow[0].cells[1].innerHTML;
var url = "/Gastos/DeleteGasto?id=" + id;
$.ajax({
url: url,
dataType: 'json'
}).done(function (response) {
if (response.success) {
gridObj.sendRefreshRequest(); // -> THIS WORKS!!!!!
}
});
}
});
} else {
$.msgbox("Debes seleccionar un registro para poder Borrarlo.");
}
});
Solved!!!
Thanks!!!
Hi Jesus.
Thanks for the update.
If you have any issues in the future, please get back to us
we will be happy to assist you.
Please let us know if you would require any further assistance.
Regards
Ragavee U S