Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jquery-ui/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery ui Wijgrid销毁数据-属性_Jquery Ui_Wijmo - Fatal编程技术网

Jquery ui Wijgrid销毁数据-属性

Jquery ui Wijgrid销毁数据-属性,jquery-ui,wijmo,Jquery Ui,Wijmo,我将一些数据属性放入表行标记中。 当我将表设置为wijgrid时,数据属性被销毁 如何防止wijmo破坏这些属性 当对行(tr)应用属性时,插件会忽略这些属性(如您所经历的),不管它们是什么(样式、类、数据……) 这似乎是自愿的,因为通常提取行属性的代码段在插件源代码中有注释 在方法readTableSection中,我们已经(我删除了此处不相关的代码行): readTableSection:函数(表、节、readAttributes){ ... if(表&(section=this.getTa

我将一些数据属性放入表行标记中。 当我将表设置为wijgrid时,数据属性被销毁


如何防止wijmo破坏这些属性

当对行(
tr
)应用属性时,插件会忽略这些属性(如您所经历的),不管它们是什么(样式、类、数据……)

这似乎是自愿的,因为通常提取行属性的代码段在插件源代码中有注释

在方法
readTableSection
中,我们已经(我删除了此处不相关的代码行):

readTableSection:函数(表、节、readAttributes){
...
if(表&(section=this.getTableSection(表,section))){
对于(ri=0,rowLen=section.rows.length;ri
我用
td
元素上的“data-”属性进行了测试,它们没有被破坏

注意:您必须使用选项
readAttributesFromData


您可以联系开发此插件的公司,询问他们为什么注释掉这一行。

在行(
tr
)上应用属性时,插件会忽略这些属性(正如您所经历的),无论它们是什么(样式、类、数据……)

这似乎是自愿的,因为通常提取行属性的代码段在插件源代码中有注释

在方法
readTableSection
中,我们已经(我删除了此处不相关的代码行):

readTableSection:函数(表、节、readAttributes){
...
if(表&(section=this.getTableSection(表,section))){
对于(ri=0,rowLen=section.rows.length;ri
我用
td
元素上的“data-”属性进行了测试,它们没有被破坏

注意:您必须使用选项
readAttributesFromData


您可以联系开发此插件的公司,询问他们为什么要注释掉这一行。

这完全出乎意料。我知道他们在创建wijmo网格时删除了属性。但他希望有一些选择来防止这种情况发生。我没想到这可能是一个错误或死代码造成的。现在这是完全出乎意料的。我知道他们在创建wijmo网格时删除了属性。但他希望有一些选择来防止这种情况发生。我没想到这可能是一个错误或死代码造成的。
readTableSection: function(table, section, readAttributes) {

    ...

    if (table && (section = this.getTableSection(table, section))) {

        for (ri = 0, rowLen = section.rows.length; ri < rowLen; ri++) {

            row = section.rows[ri];
            tmp = [];

            if (readAttributes) {

                // here normally the html attributes of the rows (<tr>) should be extracted
                // but the code is commented !
                tmp.rowAttributes = null; // $.wijmo.wijgrid.getAttributes(row);
                tmp.cellsAttributes = [];

            }

            // here is extracted the html attributes for the cells (<td>)
            for (ci = 0, celLen = row.cells.length; ci < celLen; ci++) {
                tmp[ci] = row.cells[ci].innerHTML;
                if (readAttributes) {
                    tmp.cellsAttributes[ci] = $.wijmo.wijgrid.getAttributes(row.cells[ci], prevent);
                }
            }

            result[ri] = tmp;
        }
    }

    return result;
}