rest easy service

Dear Team ,
i am evaluating your framework and it s really good.
i build a webserivce http://1-dot-container-1090.appspot.com/resteasy/library/books/mapped
i try to bind to a grid but all the try failed
the js is here

define([],function(records){

	var ui = { 
		view:"datatable", autoConfig:true,url:"resteasy/library/books/mapped"
	   
	};
 //commenter
	return {
		$ui: ui,
		$oninit:function(view){ 
			view.parse(records.data.data);
		}
	};
	
});

may you tell me how to get it right ?

thanks
regards
david

You are using two different source of data - url and some incoming data object, is it expected? Normally grid has only one source the remote url ( that must return a valid JSON data ) or a local JSON data object.

Is above url returns a valid JSON data ?

Is records.data.data is an array of data or data collection object ?

Hello,
The Json is valid, and it is generation from REST-EASY jboss.
i manage to make it work by doing by hand my own output that patch your binding requirement, and it work , it s a bit sad, but fair enough.
i thought i could iterate inside the datastructure by specifiying a kind of root path that define the iterative,repetitif data block.
thanks a lot for your answer and the good framwork
we continue to evaluate it
david

I changed the service anyway,it s why you see a strange json

Can you share a snippet of JSON data?

It possible to create a custom json parser on a client side, that will be able to recognize a custom JSON format.

Yes sir ,

http://1-dot-container-1090.appspot.com/resteasy/library/books/mapped

thanks a lot
david

on the server side :
BookListing listing = getListing();
BadgerContext context = new BadgerContext(BookListing.class);
StringWriter writer = new StringWriter();
Marshaller marshaller = context.createMarshaller();
marshaller.marshal(listing, writer);
return writer.toString();

that is easy :slight_smile:

on the client side, we could get from your ajax api and rework it…but that is a bit sad.it would be so nice to customise the data binding…as long as the repetitive block is constistent…
but you know …i am just a pure c++ guy :slight_smile:

david

thanks for the answer,this library does rock , we are going to present a project made with it .

You can try something like next

webix.DataDriver.books_json = webix.extend({
  getRecords:function(obj){
    return obj.listing.books;
  }
}, webix.DataDriver.json);


webix.ui({
  rows:[
    { view:"datatable", autoConfig:true, 
      datatype:"books_json",
      url:"http://1-dot-container-1090.appspot.com/resteasy/library/books/mapped" }
  ]
});

Hi MakSim,
i would like to thank you alot, to highlite how it must be done and give me as well the hint about the datadriver documentation, that is great , superb,thanks alot , it make the service easy to develop , easy to bing what else ? :slight_smile: :slight_smile: :wink:
i start to like javascript again :slight_smile:

thanks man
david