Java connector problems

Hi,

I am having some problems with this:

  1. when enable_log is used it throws exceptions as the log_writer is closed twice.
  2. when using the JSONCommonConnector Class I get an error in the datastore.js
[20:03:49.505] SyntaxError: missing } after property list @ http://localhost:8080/dhtmlx/dhtmlxDataStore/datastore.js:580

However, the CommonConnector does not have the same problem.

Finally, I am trying to put together a page using layout which has a grid attached to it using datastore/dataprocessor. Rather than editing in the grid I have a button that opens a dhtmlxWindow with a form attached fro a selected record. The datastore is sync’ed with the grid and bound to the form in the window.

The problem I’m having is that the form.save() updates the grid but not the database. Buttons to add/remove are reflected in the grid but not the database.

Any pointers??

For the benefit of others…

I’ve found out that if after the form.save() I also issue a

dataprocessor.sendData()

it saves the record to the database.

Reading a bit more of the docs it appears that since I set the update mode to off:

dataprocessor.setTransactionMode("POST", true); dataprocessor.setUpdateMode("off");

that is the normal behaviour. Removing the above makes the form.save() work as expected.

(2) Can you attach the example of generated json data

Sure here it is:

{ "data": [{"id":"1","purchased_on":"2012-07-18","address_id":"3","sold_on":null,"updated_by":"system","share_total":"90","type":"D","inserted_by":"system"},{"id":"2","purchased_on":"2012-07-18","address_id":"4","sold_on":null,"updated_by":"system","share_total":"90","type":"R","inserted_by":"system"},{"id":"3","purchased_on":"2012-07-18","address_id":"5","sold_on":null,"updated_by":"system","share_total":"90","type":"R","inserted_by":"system"},{"id":"5","purchased_on":"2012-07-30","address_id":"5","sold_on":null,"updated_by":"system","share_total":"90","type":"D","inserted_by":"system"},{"id":"7","purchased_on":"2012-07-25","address_id":"3","sold_on":null,"updated_by":"system","share_total":"100","type":"D","inserted_by":"system"}],"collections": {"address_id":<item value='6' label='XX XXXX 16 Somewhere Street'></item> <item value='4' label='XX XXXX 18 Somewhere Street'></item> <item value='2' label='XX XXXX 22 Somewhere Street'></item> <item value='5' label='XX XXXX 28 Somewhere Street'></item> <item value='3' label='XX XXXX 123 Somewhere'></item> <item value='1' label='XX XXXX 29 Somewhere Street'></item> , "type":<item value='D' label='Development' /><item value='R' label='Rental' />}, "total_count":"5", "pos":"0" }

As mentioned this is using the provided JSONCommonConnector class.

(2)
It seems you are using OptionsConnector to generate linked list of data, right ?
Because you main connector is a JSON connector, you need to use JSONOptionsConnector for options generation, not the OptionsConnector, which generates xml data.

doh, thanks Stanislav!! :neutral_face:

Actually, these collections are pretty redundant as aren’t reflected in the grid. I read that it is not currently supported but is being worked on. Any ideas on ETA??

Yep, we will release an update in next few days which will allow to use json-collections in the grid.

That’s great news! :slight_smile: Will it be a GA release or a patch?

Just out of interest do have have an area where all patches are available other than in the threads themselves?

If major problem is detected - we are updating existing package.
In case of minor problems - they will be included in the next stable version, until that time there is no centralized place where they all can be checked.

Sorry, still confused as I haven’t used this long enough to see updates come through.

This new release that you have mentioned - will it be a new version 3.0.n available on the web site? or will it just an updated version of the major 3.0 you already have?

OK, I can see the website now has v3.5. I have downloaded this. But still no joy :frowning:

I have attached an example…
example.rar (534 KB)

Unfortunately it was to late to include this update in dhtmlxgrid 3.5

Check attached sample, it uses updated dhtmlxgrid_json.js and shows how such json can be loaded in the grid.
example_updated.zip (658 KB)

Hi Stanislav,

This works with your example when you use grid.load but not grid.sync as I am using a datastore. Is that still a work in progress?

Syncing collection through datastore is not fully implemented yet.
Because latest version of grid can read the same data format as datastore - you can use grid as main data storage. ( it has all necessary api for data manipulations )