【问题标题】:YUI DataTable with TEXT responseType带有文本响应类型的 YUI 数据表
【发布时间】:2013-03-19 03:59:48
【问题描述】:
  //Define the columns of the table
  var myColumnDefs = new Array();
  for ( i=0; i < $names.length ; i++)
  {
    var colObjConfig = new Object();
    colObjConfig.label =$names[i];
    colObjConfig.resizeable =true;
    colObjConfig.width =150;
    myColumnDefs.push ( new YAHOO.widget.Column(colObjConfig));

  }

 var beginningScoreRow = "1111,1111|1111,1111";

 var myDataSource = new YAHOO.util.FunctionDataSource( function () { 
         return beginningScoreRow ;} );
  myDataSource.responseType = YAHOO.util.DataSource.TYPE_TEXT;
  myDataSource.responseSchema = {
            fieldDelim : ",",
            recordDelim : "|"
  }; 

  var myDataTable = new YAHOO.widget.DataTable("statusTable", myColumnDefs,     
       myDataSource);

我想为 YUI 数据源使用 TYPE_TEXT responseType。但以上未能呈现 YUI 表格列单元格中的数据。我也没有在 JS 控制台中看到任何错误。 我错过了什么?

【问题讨论】:

    标签: yui yui-datatable


    【解决方案1】:
     var column = new YAHOO.widget.Column(colObjConfig);
     column.field = ""+i+"";
     myColumnDefs.push (column );
    

    更改了列定义以添加字段属性,它成功了...

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-03-20
      • 1970-01-01
      • 2021-07-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多