Smart-Table icon indicating copy to clipboard operation
Smart-Table copied to clipboard

Ordering with more than one ordering function doesn't display change active row in IE10/11

Open bkardell opened this issue 10 years ago • 6 comments

I added a comment to the original issue with similar title about a month back, but it looks like that's closed and it might not be getting any attention (https://github.com/lorenzofox3/Smart-Table/issues/405#issuecomment-111625652)

In any case, in @lorenzofox3's working plunk, it doesn't appear to be working in IE10/11? Anyone know why?

bkardell avatar Jul 06 '15 20:07 bkardell

because Function.name is not supported by internet explorer

lorenzofox3 avatar Jul 06 '15 21:07 lorenzofox3

Ah, ok - so you leave it to whomever to decide to mokey patch in IE by toString() and then check or do something like the following http://plnkr.co/edit/y2wUXuDMyOTQBjD1lnUY?p=preview ? relevant bit would be something like

 $scope.orderring = {
    firstName: (function () {
      var ret = function (value) {
        return value.firstName;
      };
      ret.name = "firstName";
      return ret;
    }()),
    lastName: (function () {
      var ret = function (value) {
        return value.lastName;
      };
      ret.name = "lastName";
      return ret;
    }())

}

bkardell avatar Jul 06 '15 21:07 bkardell

Maybe it will do the trick, to be honest I was not aware of the issue in IE 15min ago :). But in general I am not a big fan of adding code to the core of smart table to support IE or other old browsers.

lorenzofox3 avatar Jul 06 '15 21:07 lorenzofox3

yeah, I mean either of those approaches should work -- monkey patch in this case frightens me a little -- I have to write the sorts anyway, it's not such a big deal to consciously expose a .name property and that works everywhere... Seems to work in the gist anyway. Might be worth adding a note in the docs and closed issues at least?

bkardell avatar Jul 06 '15 22:07 bkardell

Ok, I'll add a note on the doc or you can submit a PR on the documentation website

lorenzofox3 avatar Jul 06 '15 22:07 lorenzofox3

This PR https://github.com/lorenzofox3/Smart-Table/pull/612 will fix it.

I'm guessing we'll finish discussing that PR, make changes, and get it pulled in a couple of days.

douglas-treadwell avatar Jan 31 '16 23:01 douglas-treadwell