0

When I attempt to render a select widget using HTRAF, I get an "Uncaught TypeError: Cannot read property 'length' of undefined" on line 776 of jquery.htraf.js. The data-htsql attribute is filled with a proper query and I can see the results manually. The problem seems to be that the data and meta properties are not filled in via the Ajax response. Line 43 and 44 are returning undefined up the stack chain of jquery.htraf.js. Is there some config I need to do to the htsql service to get it to render the json appropriately to be compatible with the HTRAF library?

I have started the htsql service with the following command and yaml file:

htsql-ctl serve -C casemart.yaml &

htsql:
  db:
    engine: mysql
    database: casemart
    username: root
    password: *********
    host: localhost
    port: 3306
tweak.autolimit:
  limit: 1000
tweak.shell.default:
tweak.override:
  included-tables: [casemart.*]
  foreign-keys:
    - sfcase(account_id) -> sfaccount(id)
    - sfcase(owner_id) -> sfuser(id)
    - sfcase(createdby_id) -> sfuser(id)
    - sfcase(closed_date_dim_id) -> date_dim(date_id)
  • Somewhat solved my own problem. I changed the formatter in jquery.htraf.js to "raw" and now it works. It seems that something has changed in the htsql json formatter vs what HTRAF expects. I changed line 48 of jquery.htraf.js from: `HTRAF.htsqlFormatter = HTRAF.htsqlVersion == 1 ? 'jsonex':':json';` to: `HTRAF.htsqlFormatter = HTRAF.htsqlVersion == 1 ? 'jsonex':':raw';` – user2167453 Mar 13 '13 at 22:29
  • After more review, I realized that I was using tagged version 2.0.0b1 when b3 is the latest. Change set shows that the bug I found was fixed. I was following instructions at the very helpful blog entry at http://catherinedevlin.blogspot.com/2011/09/htraf-setup-from-zero.html which contained these instructions: 'sudo su - www-data cd /var/www/ wget http://htsql.org/download/HTRAF-latest.zip unzip HTRAF-latest.zip' – user2167453 Mar 14 '13 at 13:44
  • HTRAF-latest.zip does not have the latest version contained within it. – user2167453 Mar 14 '13 at 13:52

0 Answers0