Geetha
12/07/2020, 8:02 AMMohammad Sharaf Ali
12/07/2020, 3:05 PMaddToViewContextDefinition
in this doc for ref.Mohammad Sharaf Ali
12/07/2020, 3:35 PMHeader.MiniCartItemCellView.View
as a dependency.
HeaderMiniCartItemCellView.addExtraContextProperty(
'itemId',
'string',
function(context) {
return context.line.internalid;
}
);
Steve Goldberg
12/07/2020, 4:43 PMaddExtraContextProperty
like this for three reasons:
1. The method is deprecated
2. The method is internal to the core view class
3. To use it in an extension, you must add the view you want to modify as a dependency which will be blocked in a future release of SC, thus breaking this customisationSteve Goldberg
12/07/2020, 4:43 PMaddToViewContextDefinition
is the correct method to use. I tested your code in my browser console and it worked just fine, so can you give more information about how you are using it?Mohammad Sharaf Ali
12/07/2020, 6:04 PMGeetha
12/08/2020, 12:08 PM