in Vinson how do I access the child view Item.Pric...
# suitecommerce
c
in Vinson how do I access the child view Item.Price from within the ItemDetails.View?
c
Do you have a sandbox site where this is running? I can go there and look at your ItemDetails.View and see if I know the answer.
I don't have Vinson code to look it up...
@Christopher Dembek Do you have a
ProductDetails.Base.View
in Vinson?
c
No, that view came after Vinson
This is for an old project
c
What are you trying to achieve?
c
Disable the qty input as I am working on a calculator for the qty
c
Like fire an event to that disables and re-enables later?
Or just set the qty input element to disabled all the time.
c
disable the input if a custom checkbox field is checked
c
So you need a backbone event in that view. What is the custom checkbox element id?
c
the checkbox is not exposed in the UI, just a flag to trigger my calculator
c
Oh, it's driven from the back end... gotcha.
I would put this in the Item.Price (or whatever that's named in Vinson) initialize method.
c
Yea.. was trying to use getChildViewInstance(‘Item.Price’) but that doesn’t seem to work
These older versions can be a PITB
The "don't do this" section should be helpful for Vinson.
😜 1
Wrap or extend the initialize method. You can also add to the events object if you need to include user input.
👍🏻 1
I think it's something like
Copy code
ItemDetail.prototype.initialize = _.wrap(ItemDetail.prototype.initialize, function (fn) {
	var context = fn.apply(this, _.toArray(arguments).slice(1));
	// do your stuff here....
});
c
You know when you are so focused on doing something a certain way… That most obvious and simply way, that you are already using for another view, is overlooked.headbang
Thanks Chris!
👍🏻 1