开发者

Subclassing Slick.Grid

开发者 https://www.devze.com 2023-02-14 11:55 出处:网络
I\'m new to SlickGrid, and very happy with it so far. But today I came across one situation I\'m not sure how to solve.

I'm new to SlickGrid, and very happy with it so far. But today I came across one situation I'm not sure how to solve.

I'd like to add some extra HTML markup to every row, a part from the , but I didn't find any way of decorating that HTML, so I was thinking of extendin开发者_Go百科g Slick.Grid to override "appendRowHtml" method.

What inheritance technique would you suggest to do so? Or would you suggest another approach...

thanks in advance,


You could simply redefine the function instead of trying to "subclass" a javascript object. For instance:

Slick.Grid.appendRowHtml = function(...){
    ...
}

To be safe, you should copy over the old function and then work on that, to make sure your function accepts the same parameters and returns similar things. This way you can easily prevent SlickGrid from crashing.

Good luck :)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号