Webgrid hiddendatamember javascript property

1 reply. Last post: December 30, 2015 2:35 AM by Yudi
Tags :
  • New Discussion
  • New Question
  • New Product Feedback

We are currently upgrading our app and abandoning support for olde IE browsers including IE8 and everything below. The problem we ran into is that client-side api for grid, behaves differently in new browsers. When we define a HiddenDataMember on a Webgrid column, in server-side code:

  myCol = New WebGridColumn
            myCol.Name = "EmployeeId"
            myCol.DataMember = "EmployeeId"
myCol.HiddenDataMember = "EmployeeName" grid.RootTable.Columns.Add(myCol)

 on a client, we would access that property like this:

wgGetCellByName(SelectedRow,"EmployeeId").EmployeeName;

and that worked in IE8 and below, however it doesn't work in HTML5 browsers. With the new DOCTYPE html, in new browsers, that gets rendered as a direct property on a combo object, while in older browsers it's rendered as a member of attributes array on a combo object in js.

When it gets rendered as a property it is lowercased, so the property name would be "employeename" and of course, you have to get it by that name:

wgGetCellByName(SelectedRow,"EmployeeId").employeename;

 This means we have to go over all of our code and lowercase all properties. Have you encountered this issue and is there some solutio to it?


All times are GMT -5. The time now is 3:10 AM.
Previous Next