Pregunta

  //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);

I want to use TYPE_TEXT responseType for a YUI DataSource. But the above failed to render the data in the YUI table column cells. I do not see any error in JS console either. What am i missing?

¿Fue útil?

Solución

 var column = new YAHOO.widget.Column(colObjConfig);
 column.field = ""+i+"";
 myColumnDefs.push (column );

Changed the column definition to add the field property and it did the trick...

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top