| Page 1 of 2 | [ 15 posts ] | Go to page 1, 2 Next |
|
Hi Everyone,
I have a YUI datatable going against Oracle 8 in Windows Server 2003 version 5.2. It uses the yui api's links. Php version 5.1.1 but I'm using a wrapper to create the json and the return is in the correct format. YUI is version 2.8. The datafeed that the table uses returns json data fine. I tested it on the browser and can see the json string being returned is correct. However, the datatable shows the 10 rows of data expected, has pagination and all the controls from pagination working, but doesn't show any data on the rows. The rows appear blank, I click on them and the highlight works. It just shows no data. This is not a case of No Rows Found. It actually shows more than one row and doesn't have that text. I even took away pagination, filtering, and requery to have the simplest version. The rows show and again no data, so I put everything back. Weird issue. Does anyone has any ideas? Have a nice day and thanks in advance for your help. Best regards, Rudi |
|
Here's the json string returned by the datafeed:
Code: {"replyCode":200,"replyText":"Ok","data":[{"COMPANY_NAME":"AMVAC CHEMICAL","INDUSTRY_TITLE":"AG-CHEMICAL","DESCRIPTION":"SMALL"},{"COMPANY_NAME":"BAYER CROPSCIENCE","INDUSTRY_TITLE":"AG-CHEMICAL","DESCRIPTION":"LARGE"},{"COMPANY_NAME":"SYNGENTA CROP PROTECTION, INC.","INDUSTRY_TITLE":"AG-CHEMICAL","DESCRIPTION":"LARGE"},{"COMPANY_NAME":"VALENT ","INDUSTRY_TITLE":"AG-CHEMICAL","DESCRIPTION":"MEDIUM"},{"COMPANY_NAME":"AGRIUM INC.","INDUSTRY_TITLE":"AG-CHEMICAL","DESCRIPTION":"LARGE"},{"COMPANY_NAME":"CHS INC.","INDUSTRY_TITLE":"AG-CHEMICAL","DESCRIPTION":"VERY LARGE"},{"COMPANY_NAME":"MYRIANT TECHNOLOGIES, LLC","INDUSTRY_TITLE":"AG-CHEMICAL","DESCRIPTION":"SMALL"},{"COMPANY_NAME":"CHEMINOVA, INC.","INDUSTRY_TITLE":"AG-CHEMICAL","DESCRIPTION":"MEDIUM"}]} |
Alberto SantiniYUI Contributor
|
Rudi,
may you provide any snippet code or public link? Regards, Alberto |
|
Hi Alberto,
Thanks for the reply. Hope that you're doing well. The table shows 8 rows which is the right thing from the database, but no data. Below is a short version of the code, just the simple datatable that I have in the body tag of the page: Quote: <script type="text/javascript"> makeCompaniesDataTable = function() { var filter_value = ''; var searchColumnDefs = [ {key:"company_name", sortable:true, resizeable:true}, {key:"industry_title", sortable:true, resizeable:true}, {key:"description", sortable:true, resizeable:true} ]; myDataSource = new YAHOO.util.DataSource( "datafeedlist.php?" ); // JSON response myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSON; // Define the data schema myDataSource.responseSchema = { resultsList: "data", fields: ["company_name", "industry_title", "description"] }; var myDataTableConfig = { initialRequest: 'company_name=' + filter_value, scrollable: true, draggableColumns: true, caption: "<strong >Exchange Searches<\/strong >", selectionMode : 'single' }; var myDataTable = new YAHOO.widget.ScrollingDataTable( "myContainer", searchColumnDefs, myDataSource, myDataTableConfig ); }; YAHOO.util.Event.onDOMReady( makeCompaniesDataTable ); </script> Thanks in advance for your help. Best regards, Ruben |
Alberto SantiniYUI Contributor
|
Hello Rudi.
It seems correct. Maybe there is something in the stylesheet. With the debugger can you see the value in html? Maybe it is blocked or it has the same background color. Regards, Alberto |
|
Not to interject here, but the example data feed you provided has key names that are in all Uppercase. I suspect that your DataSource responseSchema needs to be PRECISELY the same definitions as the datafeed.
Thus you should have; Code: fields: ["COMPANY_NAME", "INDUSTRY_TITLE", "DESCRIPTION"] Do you agree Alberto? Todd |
Alberto SantiniYUI Contributor
|
I second Todd's suggestion. Good hint.
He said the datatable contains rows and the paginator works. With the debugger, he may see the data in the dom and verify if it is a css problem. Thanks Todd. Regards, Alberto |
|
I suspect DataSource is reading in 8 rows but doesn't know how to map them to the specified fields, thus it leaves all the 3 fields empty.
|
|
Hi Todd and Alberto,
Thank you very much for your suggestions and help. I appreciate that. Todd, your suspicion was right. The case of the columns was the problem. The data appeared once I made the column case uppercase for the datatable column definition and schema. It had to do with the mapping as you mentioned. Have a great day and weekend gentlemen. Thanks again for your help. Best regards, Rudi |
|
I'm having the same issue where the rows are showing, but no data. I've checked the case and spelling and all seems good. The data appears to be getting replaced by a (just learning the datatable so thismay be the correct behaviour). Any help would be much appreciated. Thanks.
Code: var sDataTableJSON = {"userInfo":[{"name":"Smith, Paul","age":"","level":"","experience":"31","subtotal":"$0.00"},{"name":"Jones, Steve","age":"","level":"","experience":"60","subtotal":"$0.00"},{"name":"Dow, James","age":"","level":"","experience":"31","subtotal":"$0.00"},{"name":"Reid, Jake","age":"","level":"","experience":"6","subtotal":"$10.00"},{"name":"Smith, Nancy","age":"34","level":"3r","experience":"8","subtotal":"$0.00"}]}; YAHOO.util.Event.addListener(window, "load", function() { mydatatable = function() { var datatableColumns = [ {key:"Name", sortable:true, resizeable:true}, {key:"Age", sortable:true, resizeable:true}, {key:"Level", sortable:true, resizeable:true}, {key:"Experience", sortable:true, resizeable:true}, {key:"SubTotal", sortable:true, resizeable:true} ]; var datatableSource = new YAHOO.util.DataSource(sDataTableJSON.userInfo); datatableSource.responseType = YAHOO.util.DataSource.TYPE_JSARRAY; datatableSource.responseSchema = { fields: ["name","age","level","experience","subtotal"] }; var reportDataTable = new YAHOO.widget.DataTable("divDataTable", datatableColumns, datatableSource, {caption:"results table"} ); return { oDS:datatableSource, oDT:reportDataTable }; }(); }); |
| Page 1 of 2 | [ 15 posts ] | Go to page 1, 2 Next |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group