a) the new data is not formatted as currency3) In the same grid as above I would like to have the "Description" with type ahead - where it would have a list of suggested items. The user would not be restricted to the predefined items. How can this be implemented? (there would probably be less than 100 type ahead suggestions in the list)
b) the summary totals are not updated - the totals aren't updated when I type in them manually either
c) the little red modification icon does not show up
How can I fix those issues?
var gridObj = $("#Grid").ejGrid("instance");It looks like this is replacing the existing filter every time (and if so - do I really need the "and",true ??). Also, how would I go about adding / appending to the existing filter?
gridObj.filterColumn("AccountName", ej.FilterOperators.equal, filterValue, "and", true);
public ActionResult DataSource(DataManager dm) { IEnumerable DataSource = OrderRepository.GetAllRecords(); DataResult result = new DataResult(); DataOperations operation = new DataOperations(); List<string> select = new List<string>(); if (dm.Aggregates != null) { foreach( var item in dm.Aggregates){ select.Add(item.Field); } var data = operation.PerformSelect(result.result, select); result.aggregate = data; } . . . . return Json(result, JsonRequestBehavior.AllowGet); public class DataResult { public IEnumerable result { get; set; } public int count { get; set; } public IEnumerable aggregate { get; set; } |
@(Html.EJ().Grid<object>("Grid") .Datasource(ds => ds.URL("/Home/DataSource").BatchURL("/Home/BatchUpdate").Adaptor(AdaptorType.UrlAdaptor)) . . . . .ClientSideEvents(eve=>eve.CellSave("cellSave")) )
<script type="text/javascript"> function cellSave(args) { if (args.columnName == "Freight") { var newvalue = args.value;// getting the new value var oldvalue = args.rowData.Freight;// getting the old value var extra = newvalue - oldvalue;//getting the difference in value for (var i = 0; i < this.model.summaryRows.length; i++) for (var j = 0; j < this.model.summaryRows[i].summaryColumns.length; j++) { if (this.model.summaryRows[i].summaryColumns[j].dataMember == "Freight" && this.model.summaryRows[i].summaryColumns[j].summaryType == "sum"){ j = i;// finding the summaryRow to be modified break; } } var summary = ($(".e-gridSummaryRows:eq(" + j + ")").find("td.e-summaryrow")[args.cell.index()].innerHTML).replace(/[$,]/g, "")// getting the summaryValue of the corresponding summaryRow var summaryval = (parseFloat(summary) + extra).toFixed(0); summaryval = addCommas(summaryval);//add commas to the obtained value $(".e-gridSummaryRows:eq(" + j + ")").find("td.e-summaryrow")[args.cell.index()].innerHTML = "$" + summaryval;//assigning the innerHTML of the summaryrow with updated value } }
|
Since you have expected a suggestion list to be displayed based on the the typed character, we suggest you to use the ejAutoComplete control in order to achieve your requirement. By enabling the showPopupButton property of the ejAutocomplete control, the editType acts similar to that of the dropdown control but with the predictive suggestion list as per your requirement.
Query #5: It looks like this is replacing the existing filter every time. how would I go about adding / appending to the existing filter?
We have analyzed the reported issue at our end with the code example that you have shared. We are sorry that the issue is not reproducible at our end. So could you please share the below details.