Access values in JavaScript

29 views
Skip to first unread message

Suresh Kumar Majhi

unread,
Aug 23, 2016, 7:13:29 AM8/23/16
to FlatBuffers

My Schema file is like this...

// Example IDL file for our Item's schema.
namespace Product.Sample;

table Spec {
  type:string;
  series:string;
  model:string;
  color:string;
}

table Item {
  brand:string;
  name:string;
  size:string;
  price:int;
  specification:Spec;
}

root_type Item;

I can access values for brand,name,size,price in javascript by following codes..

var brand = item.brand();
var name = item.name();
var size = item.size();
var price = item.price();

But, I can't able to understand how to access values for "specification" data ? 

Wouter van Oortmerssen

unread,
Aug 24, 2016, 12:28:15 PM8/24/16
to Suresh Kumar Majhi, FlatBuffers
var spec = item.specification();
var type = spec.type();

Does that work?

--
You received this message because you are subscribed to the Google Groups "FlatBuffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flatbuffers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Suresh Kumar Majhi

unread,
Aug 24, 2016, 12:39:05 PM8/24/16
to FlatBuffers, suresh.m...@gmail.com
Oh!!! I forgot to reply at here. I've already solved this problem & the solution is exactly what you've mentioned. Thanks a lot @Wouter for your reply.
To unsubscribe from this group and stop receiving emails from it, send an email to flatbuffers...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages