or
$("#chart").kendoChart({ title: { text: "Units sold" }, seriesDefaults: { width: 2, markers: { visible: false, }, overlay: { gradient: null } }, series: [{ type: "area", transitions: false, width: 2, data: [ 230, 0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200, 210, 220, 230, 240, 0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200, 210, 220, 230, 240, 0, 10 ] }, { type: "line", transitions: false, width: 2, data: [ 250, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 250, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 250, null, 0 ], missingValues: "interpolate" }], valueAxis: { labels: { visible: true }, line: { visible: false } }, categoryAxis: { baseUnit: "hours", baseUnitStep: 1, majorGridLines: { visible: false }, labels: { visible: true, //format: "{0}", skip: 12, step: 24, rotation: 0, format: 'dd MM yyyy' }, categories: [new Date('06/20/2013 00:00'), new Date('06/20/2013 00:00'), new Date('06/20/2013 01:00'), new Date('06/20/2013 02:00'), new Date('06/20/2013 03:00'), new Date('06/20/2013 04:00'), new Date('06/20/2013 05:00'),new Date('06/20/2013 06:00'), new Date('06/20/2013 07:00'), new Date('06/20/2013 08:00'), new Date('06/20/2013 09:00'), new Date('06/20/2013 10:00'), new Date('06/20/2013 11:00'), new Date('06/20/2013 12:00'),new Date('06/20/2013 13:00'), new Date('06/20/2013 14:00'), new Date('06/20/2013 15:00'), new Date('06/20/2013 16:00'), new Date('06/20/2013 17:00'), new Date('06/20/2013 18:00'), new Date('06/20/2013 19:00'),new Date('06/20/2013 20:00'), new Date('06/20/2013 21:00'), new Date('06/20/2013 22:00'), new Date('06/20/2013 23:00'), new Date('06/21/2013 00:00'), new Date('06/21/2013 00:00'),new Date('06/21/2013 01:00'), new Date('06/21/2013 02:00'), new Date('06/21/2013 03:00'), new Date('06/21/2013 04:00'), new Date('06/21/2013 05:00'),new Date('06/21/2013 06:00'), new Date('06/21/2013 07:00'), new Date('06/21/2013 08:00'), new Date('06/21/2013 09:00'), new Date('06/21/2013 10:00'), new Date('06/21/2013 11:00'), new Date('06/21/2013 12:00'),new Date('06/21/2013 13:00'), new Date('06/21/2013 14:00'), new Date('06/21/2013 15:00'), new Date('06/21/2013 16:00'), new Date('06/21/2013 17:00'), new Date('06/21/2013 18:00'), new Date('06/21/2013 19:00'),new Date('06/21/2013 20:00'), new Date('06/21/2013 21:00'), new Date('06/21/2013 22:00'), new Date('06/21/2013 23:00'), new Date('06/22/2013 00:00'), new Date('06/22/2013 00:00'),new Date('06/22/2013 01:00'), ], majorTickType: "none" } });
01.<ul data-role="listview" data-type="group" id="itemListView" data-click="listViewClick" data-style="inset" class="km-listview km-listgroupinset">02. 03. <li class="km-group-container words" itype="5" id="40f7eb7a426e40dbbc7ae1c3c8dc6988">04. <div class="km-group-title">05. <divclass="km-text itemTitle">Test 1</div>06. </div>07. <ul class="km-list"> 08. <li class="checkboxlimit" cbl="1" ontouchend="touchEnd(event);"><label class="km-listview-label"><input type="checkbox" id="402881343face3ff013fad11f93a0026">B1</label></li> 09. </ul>10. </li>11. 12. 13. <li class="km-group-container words" itype="2" id="160265eecc6148c39a818913dcaf9870">14. <div class="km-group-title">15. <div class="km-text itemTitle">test2</div>16. </div>17. <ul class="km-list"> 18. <li class="checkboxlimit"cbl="2"ontouchend="touchEnd(event);"><label class="km-listview-label"><input type="checkbox" id="402881343face3ff013fad11f7460021">A1</label></li> 19. <li class="checkboxlimit"cbl="2"ontouchend="touchEnd(event);"><label class="km-listview-label"><input type="checkbox" id="402881343face3ff013fad11f7940022">A2</label></li> 20. <li class="checkboxlimit"cbl="2"ontouchend="touchEnd(event);"><label class="km-listview-label"><input type="checkbox" id="402881343face3ff013fad11f7d20023">A3</label></li>21. <li class="checkboxlimit"cbl="2"ontouchend="touchEnd(event);"><label class="km-listview-label"><input type="checkbox" id="402881343face3ff013fad11f85e0024">A4</label></li>22. </ul>23. </li>24. 25.</ul>
@(Html.Kendo().ComboBox() .Name("reportTablesCombo") .HtmlAttributes(userControlAttributes) .DataTextField("Text") .DataValueField("Value") .DataSource(source => { source.Read(read => { read.Action("BuildSelectList", "ProgramManager", new { list = "Tables" }); }); }) .Events(e => { e.Change("Combo_onChange"); }) ) @(Html.Kendo().ListView(Model) .Name("fieldListView") .ClientTemplateId("template") .TagName("div") .Editable() .DataSource(dataSource =>{ dataSource.Model(model => model.Id("AdminFieldId")); dataSource.Read(read => read.Action("_Read", "ProgramManager").Data("GetTable")); dataSource.PageSize(10); }) .Pageable() )function Combo_onChange(e) { listdata.dataSource.read(); } function GetTable() { debugger; var table = (reportTablesCombo != null ? reportTablesCombo.text() : ""); return table; }public ActionResult _Read([DataSourceRequest]DataSourceRequest request, string table){ var results = appDb.AdminFields.Where(t => t.AdminTableName == table); return Json(results.ToDataSourceResult(request)); }In MVC3 using VS 2010 I used this all the time no problem. You have an order. You want to be able to view the line items. So you click View in the Custom command of the data grid and it redirects you to a view with the line items for that order. I did this all the time with no issues
Problem: MVC4, VS 2012 and IE10. Same type of thing. Click the button, it calls the Ajax which calls the proper method in the controller and passes the parameter in but does not return the View.
I assume its a JQueary issue now. I have been pounding my head against the wall for a good day now and getting nowhere.
The View
@(Html.Kendo().Grid(Model).HtmlAttributes(gridAttributes) .Name("grid") .Columns(columns => { columns.Command(command => { command.Edit().CancelText("Cancel"); command.Custom("Select").Click("showFields");}).Width(150); columns.Bound(c => c.TableName).Width(200); columns.Bound(c => c.FriendlyName).Width(200); columns.Bound(c => c.SecurityLevel).Width(125); columns.Bound(c => c.CanReportOn).Width(125).ClientTemplate("<input type='checkbox' #= CanReportOn ? checked='checked' : '' # value='#=AdminTableId#' class=\"check_row\"/>"); })The Ajax call
BTW, the preventDefault makes no difference. Same result
function showFields(e) { // e.preventDefault(); var dataItem = this.dataItem($(e.currentTarget).closest("tr")); var tableName = dataItem.TableName; $.ajax({ url: '@Url.Action("ShowFields", "ProgramManager")', type: 'POST', data: { tableName: tableName } }); }The Controller method
public ActionResult ShowFields(string tableName){ var list = appDb.AdminFields.Where(p => p.AdminTableName == tableName); var model = new AdminFieldModel { Fields = list, TableName = tableName }; return View(model);}