how to get json string data based on id?

7 posts, 0 answers
  1. Tirumalesh
    Tirumalesh avatar
    23 posts
    Member since:
    Aug 2011

    Posted 13 Mar 2012 Link to this post

    Hi all,
    My json data format class is:

     public class RestaurantInfo
        {
            public string restaurant_name { get; set; }
            public string brief_description { get; set; }
            public string full_description { get; set; }
            public string location_id { get; set; }
            public object mobile { get; set; }
            public string address_1 { get; set; }
            public string address_2 { get; set; }
            public string city_town { get; set; }
            public string state_province { get; set; }
            public string postal_code { get; set; }
            public string country { get; set; }
            public string phone { get; set; }
            public string fax { get; set; }
            public string longitude { get; set; }
            public string latitude { get; set; }
            public string business_type { get; set; }
            public string utc_offset { get; set; }
            public string website_url { get; set; }
            public string omf_file_url { get; set; }
            public object omf_private { get; set; }
        }


        public class EnvironmentInfo
        {
            public string cuisine_type_primary { get; set; }
            public string cuisine_type_secondary { get; set; }
            public string smoking_allowed { get; set; }
            public string takeout_available { get; set; }
            public object seating_qty { get; set; }
            public string max_group_size { get; set; }
            public string pets_allowed { get; set; }
            public object wheelchair_accessible { get; set; }
            public string age_level_preference { get; set; }
            public string dress_code { get; set; }
            public object delivery_available { get; set; }
            public object delivery_radius { get; set; }
            public object delivery_fee { get; set; }
            public object catering_available { get; set; }
            public string reservations { get; set; }
            public string alcohol_type { get; set; }
            public string music_type { get; set; }
        }


        public class ParentCompany
        {
            public string parent_company_name { get; set; }
            public string parent_company_website { get; set; }
            public string address_1 { get; set; }
            public string address_2 { get; set; }
            public string city_town { get; set; }
            public string state_province { get; set; }
            public string postal_code { get; set; }
            public string country { get; set; }
            public string phone { get; set; }
            public string fax { get; set; }
        }


        public class OperatingDays
        {
            public string mon_open_time { get; set; }
            public string mon_close_time { get; set; }
            public string tue_open_time { get; set; }
            public string tue_close_time { get; set; }
            public string wed_open_time { get; set; }
            public string wed_close_time { get; set; }
            public string thu_open_time { get; set; }
            public string thu_close_time { get; set; }
            public string fri_open_time { get; set; }
            public string fri_close_time { get; set; }
            public string sat_open_time { get; set; }
            public string sat_close_time { get; set; }
            public string sun_open_time { get; set; }
            public string sun_close_time { get; set; }
        }


        public class SeatingLocation
        {
            public string seating_location { get; set; }
        }


        public class Contact
        {
            public string first_name { get; set; }
            public string last_name { get; set; }
            public string email { get; set; }
            public string contact_type { get; set; }
        }


        public class AcceptedCurrency
        {
            public string accepted_currency { get; set; }
        }


        public class LogoUrl
        {
            public string logo_url { get; set; }
            public object width { get; set; }
            public object height { get; set; }
            public string image_media_id { get; set; }
            public string image_type_id { get; set; }
            public string image_type { get; set; }
            public string image_media { get; set; }
        }


        public class MenuItem
        {
            public string menu_item_name { get; set; }
            public string menu_item_description { get; set; }
            public string menu_item_price { get; set; }
            public string menu_item_calories { get; set; }
            public string menu_item_heat_index { get; set; }
            public string menu_item_allergy_information { get; set; }
            public string menu_item_allergy_information_allergens { get; set; }
            public string item_uid { get; set; }
            public string disabled { get; set; }
            public string special { get; set; }
            public string vegetarian { get; set; }
            public object vegan { get; set; }
            public object kosher { get; set; }
            public object halal { get; set; }
            public object gluten_free { get; set; }
            public List<object> menu_item_options { get; set; }
            public List<object> menu_item_sizes { get; set; }
            public List<object> menu_item_tags { get; set; }
            public List<Menu_Images> menu_item_images { get; set; }
        }


        public class Menu_Images
        {
            public string image_url { get; set; }
            public string width { get; set; }
            public string height { get; set; }
            public string image_media_id { get; set; }
            public string image_type_id { get; set; }
            public string image_type { get; set; }
            public string image_media { get; set; }


        }


        public class MenuGroup
        {
            public string group_name { get; set; }
            public string group_note { get; set; }
            public string group_description { get; set; }
            public string group_uid { get; set; }
            public string disabled { get; set; }
            public List<object> menu_group_options { get; set; }
            public List<MenuItem> menu_items { get; set; }
        }


        public class Menu
        {
            public string menu_name { get; set; }
            public string menu_description { get; set; }
            public string menu_note { get; set; }
            public string currency_symbol { get; set; }
            public string language { get; set; }
            public string disabled { get; set; }
            public string menu_uid { get; set; }
            public string menu_duration_name { get; set; }
            public string menu_duration_time_start { get; set; }
            public string menu_duration_time_end { get; set; }
            public List<MenuGroup> menu_groups { get; set; }
        }


        public class RootObject
        {
            public string omf_uuid { get; set; }
            public string omf_accuracy { get; set; }
            public object omf_private { get; set; }
            public string omf_version { get; set; }
            public string omf_updated_timestamp { get; set; }
            public RestaurantInfo restaurant_info { get; set; }
            public EnvironmentInfo environment_info { get; set; }
            public ParentCompany parent_company { get; set; }
            public OperatingDays operating_days { get; set; }
            public List<SeatingLocation> seating_locations { get; set; }
            public List<Contact> contacts { get; set; }
            public List<AcceptedCurrency> accepted_currencies { get; set; }
            public List<object> online_reservations { get; set; }
            public List<object> online_ordering { get; set; }
            public bool parking { get; set; }
            public List<LogoUrl> logo_urls { get; set; }
            public List<object> crosswalks { get; set; }
            public List<Menu> menus { get; set; }
        }

    Here i want to display menus in one div and when i click on that menu it takes me to menu_groups based on the menu_uid and so forth to menu category items. Here my problem is i can display the menus, but when i click on menu i cannot access the particular menu items based on the menu_uid and also i unable to get that id in data-init method of that div.



  2. David
    David avatar
    45 posts
    Member since:
    Feb 2012

    Posted 13 Mar 2012 Link to this post

    Why don't you put up a jsFiddle so we can all have a look?
  3. Kendo UI is VS 2017 Ready
  4. Tirumalesh
    Tirumalesh avatar
    23 posts
    Member since:
    Aug 2011

    Posted 13 Mar 2012 Link to this post

    How to put that in Fiddler?
  5. Tirumalesh
    Tirumalesh avatar
    23 posts
    Member since:
    Aug 2011

    Posted 19 Mar 2012 Link to this post

    can any one help me!
  6. Tirumalesh
    Tirumalesh avatar
    23 posts
    Member since:
    Aug 2011

    Posted 26 Mar 2012 Link to this post

    How to resolve this ?
  7. Tirumalesh
    Tirumalesh avatar
    23 posts
    Member since:
    Aug 2011

    Posted 28 Mar 2012 Link to this post

    How i need to wait for reply?

    Is there anything wrong about the post?
  8. briankb
    briankb avatar
    88 posts
    Member since:
    Feb 2004

    Posted 09 Apr 2012 Link to this post

    "Is there anything wrong about the post?"

    Yes; Several.

    Someone suggested for you to use http://jsfiddle.net/ and you replied asking how to use Fiddler which is a different program/service.

    Go to http://jsfiddle.net/ and create a page that has your code and shows the work you have done to resolve the issue. 

    People on forums and http://www.stackoverflow.com help people who are helping themselves first. You just posted a problem and asked for a solution without showing what work you have already put into resolving the issue for yourself. What things have you tried to resolve this on your own?

    I don't know the answer to your original question but I had some input on the last one.
Back to Top
Kendo UI is VS 2017 Ready