I am creating a handful of Grids in MVC. I notice that Document.Ready is called pretty quickly but the ig.loader takes quite a while.
In FireFox this is an issue because it is taking longer than 10 seconds for the grids to render.
The Razor code executes quickly. Other than changing the design of the page to create everything in javascript, instead of creating the grids in MVC, is there anyway to control when the infragistics code takes a breather to avoid the script running to long message?
At this point it looks like the databind call,
I am wondering if converting it to call back into my controller via a GridDataSourceAction, or a WebService would help.
Do you have any suggestions, or samples to point me to?
I have been able to call back into the controller, I believe that will solve the problem
Hello ddally,
Thank you for contacting Infragistics!
I have a few questions concerning this matter. What version of NetAdvantage are you using? What scripts are you loading in with the loader? How are you using the loader? Did the call back into the controller solve the problem for you?
Sincerely,Mike P.Developer Support Engineer IIInfragistics, Inc.www.infragistics.com
Version 12.2.20122.2113
@(Html.Infragistics().Loader() .ScriptPath(Url.Content("~/Scripts/Infragistics/")) .CssPath(Url.Content("~/Content/Infragistics/")) .Resources("igCombo,igGrid.Filtering") .Theme("infragistics") .Render())
The call back only partially solved the problem because it is called during the time I create them with the Razor/MVC code.
I am basically trying to create all of the grids on the page without loading any data, just setting the columns/model up and then have the events to bind to the data fire
The problem I have is that I need to create about 20 - 30 grids on a page and it is taking a considerable amount of time. I am currently doing this through a loop with Razor code and I am debating moving it to Javascript.
I am doing something like the following
@foreach (var physician in physicians) {
var linkId = openCloseLink + physician.UserObjectID;
var gridId = gridPatients + physician.UserObjectID;
<div class="gridPatientInfo">
@(@Html.Infragistics().Grid<PatientGridMember>()
.ID(gridId).PrimaryKey("PatientListMembersID")
.LoadOnDemand(false).AutoGenerateColumns(false).AutoGenerateLayouts(false).EnableUTCDates(true)
.EnableHoverStyles(true).RenderCheckboxes(true).LocalSchemaTransform(true).AutoCommit(true)
.Columns(GenerateChildColumns)
.Features(feature => {
feature.Sorting().Mode(SortingMode.Single);
feature.Selection().Mode(SelectionMode.Row).MultipleSelection(true);
feature.RowSelectors().EnableCheckBoxes(true).EnableRowNumbering(false);
feature.Resizing().AllowDoubleClickToResize(true);
feature.Updating().EditMode(GridEditMode.Cell).
EnableDeleteRow(false).EnableAddRow(false).ColumnSettings(CreateColumnSettings);
})
.DataSource(Model)
.DataSourceUrl(Url.Action("GetGridData", "PatientMapping2", new {
patientListID = ViewData["PatientListID"],
patientListUserObjectsID = physician.UserObjectID
}))
.DataBind()
.CalculateWidthAndHeight()
.Render()
)
</div>
}
On a side note when I hook into the iggriddatabound I can see that the dataView contains the correct data however grid.rows() is always 0 until some time later, what event is safe to hook into in order to know that the grid is fully operational
Thank you for the update. I have discussed this further with my team and have the following suggestion. You can try instead of using the load have individual script references for just the scripts you use instead using the loader to load the scripts for you. You can also have a loading message or icon display until the controls are done loading.
Unfortunately the MVC Render method and what is associated with it is just taking a very long time when I have a lot of grids.
I have had to remove the MVC code and put it in javascript where can create a grid every so often so as not to stop the browser from being unresponsive
Even putting up a loading message is frustrating when trying to create 30 grids and it takes several minutes
Yes,
Moving away from the MVC model allowed me greater control and solved the problem I was having.
Thanks,
I am following up to see if this matter has been resolved. If this isn’t the case please let me know what questions you have concerning this matter.
Please let me know if I may be of further assistance with this matter.
Thank you for the update. I am glad to hear that using JavaScript for the igGrid is working for you. Do you have any further questions concerning this matter?
Sorry had a typo -- It was supposed to say -- javascript version is NOW manageable
Generally I only have 2 - 3 records per grid. I have a set of maybe 30 - 40 physicians in a hospital with each being assigned a handful of patients.
Moving to javascript/html only was not that difficult, in fact I find it perhaps a better way to keep full control of the calls I am making. I have some improvement to do but the javascript version is not manageable, only because I can keep the page responsive because I am in control of when I created each grid.