Hi Guys, I want to get the Item Field or Item Mod...
# suitecommerce
m
Hi Guys, I want to get the Item Field or Item Model can i get and pass it to the
uomModuleView
model under the `Cart.addChildView(Item.Sku`as shown below
Copy code
define('TEM.CDPShowUoM.uomModule', ['TEM.CDPShowUoM.uomModule.View'], function (uomModuleView){
	'use strict';
	return  {
		mountToApp: function mountToApp (container)
		{	
			var Cart = container.getComponent('Cart');
			
			if(Cart)
			{				
				Cart.addChildView('Item.Sku', function() {					
					return new uomModuleView({ container: container });;
				});
			}			
		}
	};
});
Regards,
s
You should be able to do that with using contextDataRequest in the view. For an example, see https://developers.suitecommerce.com/show-color-option-images-on-a-product-list-page.html
m
Can i get the item information in this
uomModuleView
?
s
Yes if you're adding it to the view chain of one of the supported parent views, see here: https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/article_164148475043.html#subsect_164260470971
m
Thanks @Steve Goldberg for your help, I really appreciated
One last thing i want to ask can we remove or reset the version of the extension in Netsuite Extension Manager
s
You will need to manually delete the associated records
m
Thanks,
I'm getting Request context data is not valid for this child view instance error on
uomModule.View.js
what are the contextData available in
Cart.Detailed.View
Cart.Lines
Copy code
define('TEM.CDPShowUoM.uomModule.View',	['tem_cdpshowuom_uommodule.tpl', 'Backbone'], function (tem_cdpshowuom_uommodule_tpl, Backbone){
    'use strict';

	return Backbone.View.extend({

		template: tem_cdpshowuom_uommodule_tpl,
		contextDataRequest: ['item'],			
		initialize: function (options) {
			console.log(options);			
		},
		getItemFields: function getItemFields(){
			try
			{				
				console.log(this.contextData);
				console.log(this.contextData.item());
			}
			catch(e)
			{
				console.log(e);
			}
		},
		events: {
		},	
		bindings: {
		}, 	
		childViews: {

		},

		//@method getContext @return TEM.CDPShowUoM.uomModule.View.Context
		getContext: function getContext()
		{
			this.getItemFields();			
			return {
				uomValue: this.message | 'Box'
			};
		}
	});
});
What are the contextDataRequest option available in Cart.Detailed.View /Cart.Lines Page
s
Please read the documentation links I provided you
m
I read it that belongs to the PLP I want to do the same thing in Cart Page but it is showing error in that page. maybe I'm passing the item in context data request that might be wrong can i have list of contextdatarequest of Cart Page
s