toreachdeepak Posted August 21, 2009 Report Share Posted August 21, 2009 Hi,How do I access the members of oContextMenuItems ? Is it array of array ? var oContextMenuItems = { "tdclass01": [ "Edit Row0,Column1", "Cancel Row0,Column1" ] };ThanksDeepak Link to comment Share on other sites More sharing options...
Ingolme Posted August 21, 2009 Report Share Posted August 21, 2009 (edited) It's an Object. You access an object property with a dot '.': alert(oContextMenuItems.tdclass01); What's written in your code is equivalent to this: var oContextMenuItems = new Object();oContextMenuItems.tdclass01 = new Array();oContextMenuItems.tdclass01[0] = "Edit Row0,Column1";oContextMenuItems.tdclass01[1] = "Cancel Row0,Column1"; You don't need quotes around the property name. You could write it like this: var oContextMenuItems = { tdclass01:[ "Edit Row0,Column1", "Cancel Row0,Column1" ]} Edited August 21, 2009 by Ingolme Link to comment Share on other sites More sharing options...
toreachdeepak Posted August 21, 2009 Author Report Share Posted August 21, 2009 It's an Object. You access an object property with a dot '.':alert(oContextMenuItems.tdclass01); What's written in your code is equivalent to this: var oContextMenuItems = new Object();oContextMenuItems.tdclass01 = new Array();oContextMenuItems.tdclass01[0] = "Edit Row0,Column1";oContextMenuItems.tdclass01[1] = "Cancel Row0,Column1"; You don't need quotes around the property name. You could write it like this: ThanksDeepak Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now