Why am I getting pagination twice when I fill my yahoo table
Why am I getting pagination twice when I fill my yahoo table? I am deleting my yahoo table before I fill it. I just want to inform you that the table fills with the right data.
var MedicalFilesTable = document.getElementById('MedicalFilesTable');
if(MedicalFilesTable.hasChildNodes())
{
while(MedicalFilesTable.childNodes.length >= 1)
{
MedicalFilesTable.removeChild(MedicalFilesTable.firstChild);
}
}
YAHOO.example.Medical开发者_StackOverflowFilesTable = function()
{
var MyColumnDefs = [
{key:"eventid", label: "Event Id",sortable:true,formatter: YAHOO.widget.DataTable.formatAxsOppLink},
{key:"PartOfAMulti", label: "Multi?",sortable:true,formatter: YAHOO.widget.DataTable.formatAxsOppLink}
];
var MyDataSource = new YAHOO.util.DataSource(gMedicalFilesArray);
MyDataSource.responseType = YAHOO.util.DataSource.TYPE_JSARRAY;
MyDataSource.responseSchema = {fields: ["eventid","PartOfAMulti"]};
var MyConfigs = {paginator : new YAHOO.widget.Paginator({rowsPerPage: 10})};
var MyDataTable = new YAHOO.widget.DataTable("MedicalFilesTable", MyColumnDefs, MyDataSource,MyConfigs);
return {oDS: MyDataSource, oDT: MyDataTable};
}();
The pagination might not be a child node but another object/property that gets generated to the DOM. try replacing your "MedicalFilesTable" with a new DOM Object.
try to reset the paginator object.. like
var MyConfigs = {};
MyConfigs = {paginator : new YAHOO.widget.Paginator({rowsPerPage: 10})};
精彩评论