I have just converted one of my toolbars from RadControls Asp.Net to the New ToolBar in the 2008.1 Futures.
A the end of the page, after the </form> I kick of a number of ajax requests(using a light weight framework), those callbacks update the status of the tool bar buttons.
This worked fine in the old version, however with the new version it appears the javascript toolbar object is created a long after the toolbar is displayed. I use $find as late as possible to get the toolbar object (within the ajax callback) . However it does not appear to exist until well after the toolbar has displayed.
So when I call $find a null is returned.
I can see the following in the code :
Sys.Application.add_init(function() {
$create(Telerik.Web.UI.RadToolBar, {"_skin":"Office2007","attributes":{},"clientStateFieldID":"ctl00_ContentPlaceHolder_CTb_ClientState","collapseAnimation":"{\"type\":12,\"duration\":200}","itemData":[{"value":"Insert","commandName":"Insert","toolTip":"Insert Item","cssClass":" rtbWrap","imageUrl":"http://206.196.22.102/resource/toolbar/insert.gif"},{"value":"Cancel","commandName":"Cancel","toolTip":"Cancel current Operation","cssClass":" rtbWrap","imageUrl":"http://206.196.22.102/resource/toolbar/cancel.gif"},{"value":"Back","commandName":"Back","toolTip":"Return to previous Operation","cssClass":" rtbWrap","imageUrl":"http://206.196.22.102/resource/toolbar/return.gif"},{"value":"Print","commandName":"Print","toolTip":"Print contents","cssClass":" rtbWrap","imageUrl":"http://206.196.22.102/resource/toolbar/print.gif"},{"value":"Config","commandName":"Config","toolTip":"Edit Configuration","cssClass":" rtbWrap","imageUrl":"http://206.196.22.102/resource/toolbar/option.gif"},{"value":"Export","commandName":"Export","toolTip":"Export Items","cssClass":" rtbWrap","imageUrl":"http://206.196.22.102/resource/toolbar/excel.gif"},{"value":"Import","commandName":"Import","toolTip":"Import Items","cssClass":" rtbWrap","imageUrl":"http://206.196.22.102/resource/toolbar/excel.gif"},{"value":"Admin","commandName":"Admin","toolTip":"Administration","cssClass":" rtbWrap","imageUrl":"http://206.196.22.102/resource/toolbar/admin.gif"},{"value":"Tool","commandName":"Tool","toolTip":"Run Tool","cssClass":" rtbWrap","imageUrl":"http://206.196.22.102/resource/toolbar/cog.gif"},{"value":"Map","commandName":"Map","toolTip":"View Map","cssClass":" rtbWrap","imageUrl":"http://206.196.22.102/resource/toolbar/map.gif"},{"value":"List","commandName":"List","toolTip":"View List","cssClass":" rtbWrap","imageUrl":"http://206.196.22.102/resource/toolbar/list.gif"}]}, {"buttonClicked":contentTBClickHandler}, null, $get("ctl00_ContentPlaceHolder_CTb"));
});
Which is before the code where I triggered the Ajax requests, I assume since its being added to an initialization function that the toolbar is created at some latter stage.
What is the best approach here, Does this mean I should put my code in a a delegate function attached to the Sys.Application.add_load event.
A the end of the page, after the </form> I kick of a number of ajax requests(using a light weight framework), those callbacks update the status of the tool bar buttons.
This worked fine in the old version, however with the new version it appears the javascript toolbar object is created a long after the toolbar is displayed. I use $find as late as possible to get the toolbar object (within the ajax callback) . However it does not appear to exist until well after the toolbar has displayed.
So when I call $find a null is returned.
I can see the following in the code :
Sys.Application.add_init(function() {
$create(Telerik.Web.UI.RadToolBar, {"_skin":"Office2007","attributes":{},"clientStateFieldID":"ctl00_ContentPlaceHolder_CTb_ClientState","collapseAnimation":"{\"type\":12,\"duration\":200}","itemData":[{"value":"Insert","commandName":"Insert","toolTip":"Insert Item","cssClass":" rtbWrap","imageUrl":"http://206.196.22.102/resource/toolbar/insert.gif"},{"value":"Cancel","commandName":"Cancel","toolTip":"Cancel current Operation","cssClass":" rtbWrap","imageUrl":"http://206.196.22.102/resource/toolbar/cancel.gif"},{"value":"Back","commandName":"Back","toolTip":"Return to previous Operation","cssClass":" rtbWrap","imageUrl":"http://206.196.22.102/resource/toolbar/return.gif"},{"value":"Print","commandName":"Print","toolTip":"Print contents","cssClass":" rtbWrap","imageUrl":"http://206.196.22.102/resource/toolbar/print.gif"},{"value":"Config","commandName":"Config","toolTip":"Edit Configuration","cssClass":" rtbWrap","imageUrl":"http://206.196.22.102/resource/toolbar/option.gif"},{"value":"Export","commandName":"Export","toolTip":"Export Items","cssClass":" rtbWrap","imageUrl":"http://206.196.22.102/resource/toolbar/excel.gif"},{"value":"Import","commandName":"Import","toolTip":"Import Items","cssClass":" rtbWrap","imageUrl":"http://206.196.22.102/resource/toolbar/excel.gif"},{"value":"Admin","commandName":"Admin","toolTip":"Administration","cssClass":" rtbWrap","imageUrl":"http://206.196.22.102/resource/toolbar/admin.gif"},{"value":"Tool","commandName":"Tool","toolTip":"Run Tool","cssClass":" rtbWrap","imageUrl":"http://206.196.22.102/resource/toolbar/cog.gif"},{"value":"Map","commandName":"Map","toolTip":"View Map","cssClass":" rtbWrap","imageUrl":"http://206.196.22.102/resource/toolbar/map.gif"},{"value":"List","commandName":"List","toolTip":"View List","cssClass":" rtbWrap","imageUrl":"http://206.196.22.102/resource/toolbar/list.gif"}]}, {"buttonClicked":contentTBClickHandler}, null, $get("ctl00_ContentPlaceHolder_CTb"));
});
Which is before the code where I triggered the Ajax requests, I assume since its being added to an initialization function that the toolbar is created at some latter stage.
What is the best approach here, Does this mean I should put my code in a a delegate function attached to the Sys.Application.add_load event.