In the process of developing with WINJS, such as adding a pivot control, adding pivotitem1,pivotitem2 ...
Execute the corresponding PivotItem statement in the JS file, you will find such a situation:
PivotItem1 is the first time the program starts to render the elements in the interface, and ITEM2, ITEM3 has not been initialized, this time if the simple JS in the data binding Item2, Item3 value,
The "0x800a138f-javascript runtime error:unable to set property ' Itemdatasource ' of undefined or null reference" appears.
This time by adding breakpoints debugging only found that the control of the Wincontrol is undefined, so xxx.winControl.itemDataSource certainly also for undefined.
Then you need to initialize the PIVOTITEM2, 3 control first, which solves the problem of Wincontrol as undefined:
// Original JS: var glistv = document.getElementById ("Guidelistview"= data.datasource; // to be replaced by: var glistv = document.getElementById ("Guidelistview"); WinJS.UI.processAll (GLISTV). Then (function dataBinding () { = data.datasource;});
[WP8 Development] Solution for Wincontrol or Itemdatasource value NULL in WINJS