jQWidgets Forums
jQuery UI Widgets › Forums › Grid › bind jqxGrid not working ?
This topic contains 1 reply, has 2 voices, and was last updated by Dimitar 8 years, 5 months ago.
Viewing 2 posts - 1 through 2 (of 2 total)
-
Author
-
Any suggestions greatly appreciated.
Jon
Hello, followed the tutorial (replaced my data) but does not populate:
this is the code for grid.xhtml which does not work:
<!DOCTYPE html> <html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"> <h:head> <title>This example shows jqxGrid binding to MySQL using JSF.</title> <h:outputStylesheet name="css/jqx.base.css" /> <h:outputStylesheet name="css/jqx.arctic.css" /> <h:outputScript name="js/jquery.js" /> <h:outputScript name="js/jqxcore.js" /> <h:outputScript name="js/jqxbuttons.js" /> <h:outputScript name="js/jqxdata.js" /> <h:outputScript name="js/jqxscrollbar.js" /> <h:outputScript name="js/jqxmenu.js" /> <h:outputScript name="js/jqxcheckbox.js" /> <h:outputScript name="js/jqxlistbox.js" /> <h:outputScript name="js/jqxdropdownlist.js" /> <h:outputScript name="js/jqxgrid.js" /> <h:outputScript name="js/jqxgrid.sort.js" /> <h:outputScript name="js/jqxgrid.pager.js" /> <h:outputScript name="js/jqxgrid.selection.js" /> <h:outputScript name="js/jqxgrid.edit.js" /> <h:outputScript target="body"> $(document).ready(function() { var source = { datatype: "json", datafields: [{ name: 'caseno', type: 'string' }, { name: 'name', type: 'string' }, { name: 'dateincident', type: 'date' }], id: 'id', localdata: '#{queryBean.getDataList()}' }; var dataAdapter = new $.jqx.dataAdapter(source); $('#jqxgrid').jqxGrid({ theme: 'arctic', width: 550, autoheight: true, source: dataAdapter, columns: [{ text: 'Number', datafield: 'caseno', width: 100 }, { text: 'Name', datafield: 'name', width: 100 }, { text: 'Date', datafield: 'dateincident', cellsformat: 'd', align: 'right', cellsalign: 'right' }] }); }); </h:outputScript> </h:head> <h:body> <div id="jqxgrid"></div> </h:body> </html>
this is the code for index.xhtml which does work:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"> <h:head> <title>queryData</title> </h:head> <h:body> <h:dataTable id="query" width="100%" value="#{queryBean.getDataList()}" var="u" border="1"> <h:column> <f:facet name="header">Number</f:facet> #{u.caseno} </h:column> <h:column> <f:facet name="header">Name</f:facet> #{u.name} </h:column> <h:column> <f:facet name="header">Date 1</f:facet> #{u.dateincident} </h:column> <h:column> <f:facet name="header">Date 2</f:facet> #{u.datearrestdatetime} </h:column> <h:column> <f:facet name="header">Date 3</f:facet> #{u.datedefensecourt} </h:column> <h:column> <f:facet name="header">Date 4</f:facet> #{u.dateadaassigned} </h:column> <h:column> <f:facet name="header">Date 5</f:facet> #{u.datenextappearance} </h:column> </h:dataTable> </h:body> </html>
Hello Jon,
Please see my reply in your other topic: http://www.jqwidgets.com/community/topic/is-this-forum-active/#post-89822.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/ -
AuthorPosts
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic.