Foros de discusión
Datatable - emptyMessage
Ryan Stapleton, modificado hace 9 años.
Datatable - emptyMessage
New Member Mensajes: 5 Fecha de incorporación: 1/08/14 Mensajes recientes
I seem to be missing something and I hope its something simple.
I have a datatable that I am loading with a datasource.io (JSON with Y.Plugin.DataSourceJSONSchema) and the table loads on page load like I want. I have a datepicker so I can change a date and it loads the new set of data again like I am looking for.
The problem I have if the particular date does not have any date it does not show an emptyMessage correctly.
When I add the 'datatable-message' to the YUI().use I get some extra space between the header and table body for the initialRequest of data which isn't right. When I goto another date that does not have data I get my emptyMessage message but any set of data after that it shows the emptyMessage regardless if there is data in the table or not.
I link the datasource to the datatable with:
Where myDataVar is the var created with:
url is the url of the JSON returning servlet.
Any thoughts?
I have a datatable that I am loading with a datasource.io (JSON with Y.Plugin.DataSourceJSONSchema) and the table loads on page load like I want. I have a datepicker so I can change a date and it loads the new set of data again like I am looking for.
The problem I have if the particular date does not have any date it does not show an emptyMessage correctly.
When I add the 'datatable-message' to the YUI().use I get some extra space between the header and table body for the initialRequest of data which isn't right. When I goto another date that does not have data I get my emptyMessage message but any set of data after that it shows the emptyMessage regardless if there is data in the table or not.
I link the datasource to the datatable with:
table.plug( Y.Plugin.DataTableDataSource, {
datasource: myDataVar,
initialRequest: url
});
Where myDataVar is the var created with:
var myDataVar = new Y.DataSource.IO({ source: url });
url is the url of the JSON returning servlet.
Any thoughts?
Ryan Stapleton, modificado hace 9 años.
RE: Datatable - emptyMessage (Respuesta)
New Member Mensajes: 5 Fecha de incorporación: 1/08/14 Mensajes recientes
I feel this is a hack but seems to work.
I got the data from the table:
I kinda assumed this would be built in...
I got the data from the table:
var data = node.get('data');
if the thisdata.size() == 0 {
Y.one('tbody.table-message').show();
} else {
Y.one('tbody.table-message').hide();
}
I kinda assumed this would be built in...