HTML表控件:以编程方式隐藏和更改列名称 [英] HTML table control: hiding and changing column names programmatically

查看:72
本文介绍了HTML表控件:以编程方式隐藏和更改列名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

对此可能有一个简单的答案.

There is probably a simple answer to this.

给出一个HTML表格(VS2013中的新增功能),该表格具有名为"Answer1"的列,我假设我可以使用.isVisible和.displayName来隐藏列或更改列标题,如下所示. >

Given a HTML table (new in VS2013) that has a column called 'Answer1', I assumed that I could use the .isVisible and .displayName to hide a column or change a column header like below....

myapp.ViewTopic.Answer1_postRender = function (element, contentItem) {
    setTimeout(function () {
        contentItem.isVisible = false; 
        contentItem.displayName = "Testing123";
    }, 100); 
};

但是,这不起作用.当表处于重排模式(即电话大小)时,.isVisible实际上可以工作,但当其显示为表时则无效.

However this doesn't work. The .isVisible actually works when the table is in reflow mode (ie phone size), but not when it shows as a table.

.displayName似乎根本不起作用.

The .displayName doesn't seem to work at all.

我应该以编程方式访问表列吗?

Is there a difference property that I should be accessing to table columns programmatically?

谢谢你,马特


推荐答案

您好,马特

仅需注意LS HTML表和IE9,有一个错误会导致表无法在IE9中显示,以防万一您的受众可能正在使用该特定的浏览器,则该修复计划在下一个版本中发布,不确定何时发布是.

Just a note on LS HTML tables and IE9, there is a bug that causes tables to not display in IE9 just in case your audience may be using that specific browser, the fix is scheduled for the next release, not sure when that is though.

此帖子中有一种解决方法:

There is a workaround in this post:


这篇关于HTML表控件:以编程方式隐藏和更改列名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆