'umbraco.MacroEngines.DynamicXml' does not contain a definition for 'Skip'
I am looking at paging a ucomponents multi-node tree picker property, but it returns dynamic xml data which does not contain a definition for 'Skip' or 'Take'.
How can I go about using Skip and Take, like follows, on DynamicXml?
var pagesToList = @Model.Children; @foreach(var item in pagesToList.Skip(currentPage*itemsPerPage).Take(itemsPerPage)) { ... }
var nodes = uComponents.Core.uQuery.GetNodesByXml(CurrentModel.GetPropertyValue("multiNodeTreePicker", true)); foreach(var n in nodes.Skip(1 * 1).Take(1)) { @n.Name }
or
@{ var nodes = Library.NodesById(Model._nodePicker.Split(',')); } @foreach (var n in nodes.Skip(1 * 1).Take(2)) { @n.Name<br /> }
Yeah I was more dabbling with the Skip Take ext, I was mixing some code up to see if it would work trying to mix DynamicXml with the paging example in umbraco 4.7.1
'umbraco.MacroEngines.DynamicXml' does not contain a definition for 'Skip'
I am looking at paging a ucomponents multi-node tree picker property, but it returns dynamic xml data which does not contain a definition for 'Skip' or 'Take'.
How can I go about using Skip and Take, like follows, on DynamicXml?
Sorry to bump but did you discover a solution for this I am trying to page some xml which returns in DynamicXml
Doogie.
Hi Doogie
I actually can't remember. Think I abandoned my original idea as couldn't find a solution.
Quick search found this post http://our.umbraco.org/forum/developers/razor/27730-DAMP-Paging-error-(umbracoMacroEnginesDynamicXml-contains-no-definition-for-Skip)
Possibly use Library.NodesById as described in the Umbraco Razor Snippets http://umbraco.com/follow-us/blog-archive/2011/9/22/umbraco-razor-feature-walkthrough%E2%80%93part-8.aspx
Might be able to pass all the IDs in to return a DynamicNodeList and see if you can use Skip and Take
Also look at uComponents helper methods, in particular GetNodesByXml
http://ucomponents.codeplex.com/wikipage?title=uQuery&referringTitle=Documentation
http://our.umbraco.org/wiki/reference/code-snippets/razor-snippets/get-values-from-ucomponents-multi-node-tree-picker-multiple-textstring
Possible working solutions as follows
var nodes = uComponents.Core.uQuery.GetNodesByXml(CurrentModel.GetPropertyValue("multiNodeTreePicker", true));
foreach(var n in nodes.Skip(1 * 1).Take(1)) {
@n.Name
}
or
@{
var nodes = Library.NodesById(Model._nodePicker.Split(','));
}
@foreach (var n in nodes.Skip(1 * 1).Take(2)) {
@n.Name<br />
}
Hope this helps
Yeah I was more dabbling with the Skip Take ext, I was mixing some code up to see if it would work trying to mix DynamicXml with the paging example in umbraco 4.7.1
I thought it would be fairly simple :)
is working on a reply...