Does Kendo UI PanelBar support HierarchicalDataSource? - hierarchy

Does Kendo UI PanelBar support HierarchicalDataSource?
I have code that works for Kendo TreeView but if instead of a TreeView I tell it to build a PanelBar, no control is constructed.
I am using 2012 Q3 -- Is this even supported or am I trying something that is not implemented?
var ss = new kendo.data.HierarchicalDataSource({ data: panelBarSource });
$('#panelBar').kendoPanelBar({
dataSource: ss,
dataValueField: "id",
dataTextField: "name"
});
panelBarSource resembles:

Kendo UI PanelBar currently doesn't support hierarchical data source. Alternatively you can use a JSON object to initialize it. Check the docs for more information:
http://docs.kendoui.com/getting-started/web/panelbar/overview#initialize-a-panelbar-using-json-data-object

As of this writing PanelBar does support hierarchical data model:
Please review the following link:
You'll find it about half way down...

Related

Change text of PAGE N OF M of mvcgrid.net

I am using mvcgrid.net for showing my information in tables in a mvc project
How ever it is working properly I want to change
Showing 1 to 10 of 27 entries
of footer and
next and previous
texts of grid but I didn't find an API for that , Can anyone help me with this.
I am configuring my Grid as:
GridDefaults gridDefaults = new GridDefaults()
{
RenderingMode = RenderingMode.Controller,
ViewPath = "~/Views/MVCGrid/_Grid.cshtml",
NoResultsMessage = "Sorry, no results were found",
ItemsPerPage = 25,
MaxItemsPerPage = 200
};
and I update the text of anything I need in the _Grid.cshtml file or any custom View I use instead.
Custom Style
To use a custom style for your table, you can implement the IMVCGridRenderingEngine to create your table. Everything you need to populate your table will be given to you in the RenderingModel object. Once you have the implementation, set the property on your grid definition to use your new rendering engine:
gridDef.DefaultRenderingEngine = typeof(CustomHtmlRenderingEngine);
This same method could also be used to create custom export formats.
You can find it from the link.
http://mvcgrid.net/demo/customstyle

Why my DevExpress v14.1 doesn't have the GridViewEdittingMode component?

According to the official document of DevExpress : https://documentation.devexpress.com/#AspNet/DevExpressWebGridViewEditingModeEnumtopic , the assembly which contains GridViewEditingMode component should be DevExpress.Web.v14.1.dll. However, I tried to add it to my reference, it still said GridViewEditingMode does not exist. The hash code of my DevExpress.Web.v14.1.dll is SHA256 CFDE95612BA9D4A771DD0236D95A8A1881BE983DC72985205E36134CA37D1075. Worse still, I don't have the project converter in my computer, nor does DevExpress provide v14.1 trial anymore.
Is there any one who knows how to make GridViewEditingMode component be available in a DevExpress v14.1 based project?
Looks like you faced this breaking change (Some classes related to DevExpress ASP.NET controls have been moved to the DevExpress.Web namespace). So, the namespace where the GridViewEditingMode enumeration is implemented was changed from DevExpress.Web.ASPxGridView to DevExpress.Web. The following code should work for you.
var grid = Html.DevExpress().GridView(settings =>
{
settings.Name = "GridView";
// code
settings.SettingsEditing.Mode = DevExpress.Web.ASPxGridView.GridViewEditingMode.EditFormAndDisplayRow;
// code
});

SAPUI5 / OpenUI5 Databinding for Custom Controls

I'm working with SAPUI5 and OpenUI5. I'ved developed some custom controls for now but never used the 2-Way Databinding for this controls...I've tried it with
oMyControl.bindProperty("someValue", "oModel>/testBindingValue")
What I've seen is: When watching the Model in the debugger the field aBindings have one entry:
sPath: "/testBindingValue"
sInternalType: "int"
and the correct sInternalType of my Controls property type (in this case "int").
But when I'm watching the array oModel.oData it is empty and oModel.getProperty("/testBindingValue")
is also returning undefined...but my control definitely has a value for "someValue"...So, does anyone have an idea?
Thanks,
Alex
UPDATE:
Here you see my workflow:
first creating the model:
var oModel = new sap.ui.model.json.JSONModel();
sap.ui.getCore().setModel(oModel, 'oModel');
then initializing my control:
var oMyControl = new MyControl({
someValue: "Test Value of the Control"
});
oMyControl.bindProperty("someValue", "oModel>/testValue");
Now, when I'm doing:
alert(oModel.getProperty("/testValue"));
I will get "undefined".
So, for normal controls this is working, for "value", "text", "visible" or "enabled" and so on..
I'm guessing there is something in your custom control that is making this not work correctly. I have created an example of what I understand you are doing (http://jsbin.com/kiwoza/2/edit?html,console,output) and it seems to work as I'd expect. If this example is somehow different from what you're trying to accomplish please update the question with details about why it's not quite right.

How to access the controls of an Active Reports (Data Dynamics)

The company I work for uses the Active Reports from DataDynamics to generate their reports and they asked me if I could do a web viewer of the reports where you could move the fields around.
So the way I figured I could do this was to load the empty reports (with only the fields like they appear in the designer in VS2012) in divs and use Jquery for the moves than create the report dynamically.
The thing is, I cannot find a way to access the controls of the report. I've been googling hwo to do this for a whole day but I cannot seem to find a solution.
We are using Active Reports 6, VS2012 and vb.net.
Each Section in the report has a Controls collection that reveals the collection of controls in that section. The topic on the Sections collection has a good example of how to programatically add controls to the collection. An excerpt with some comments to help explain is below:
' Insert Group Header and Footer Sections:'
Me.Sections.InsertGroupHF()
' Set some proprties to configure those sections:
CType(Me.Sections("GroupHeader1"), GroupHeader).DataField = "CategoryID"
Me.Sections("GroupHeader1").BackColor = System.Drawing.Color.SlateBlue
Me.Sections("GroupHeader1").CanGrow = True
Me.Sections("GroupHeader1").CanShrink = True
CType(Me.Sections("GroupHeader1"), GroupHeader).RepeatStyle = RepeatStyle.OnPageIncludeNoDetail
Me.Sections("GroupHeader1").Height = 0
' Create a TexBox control & Set some properties to configure that control
Dim txt As New TextBox()
txt.DataField = "CatagoryID"
txt.Location = New System.Drawing.PointF(0.0F, 0)
txt.Width = 2.0F
txt.Height = 0.3F
txt.Style = "font-weight: bold; font-size: 16pt"
' Add the TextBox to the GroupHeader section:
Me.Sections("GroupHeader1").Controls.Add(txt)
The ActiveReports 6 documentation has a walkthrough named Run Time Layouts that builds an entire application that builds a report layout in code. That's a good way to learn exactly how to manipulate a report via code.
#activescott & #Michael, the documentation links changed, but they are still available. For the ActiveReports 6 Documentation go here, and the walkthrough for Run Time Layouts is here.

Quotes in Asp.NET MVC View

In View,
#{
Layout = "~/Views/Shared/site.cshtml";
ViewBag.Title = "Organizations";
var organizations = "";
foreach (var org in Model)
{
organizations += "'" + org.Name + "':'" + org.Id + "',";
}
organizations = organizations.Substring(0, organizations.Length - 1);
}
Result operation: organizations = "'Passport':'14f0eac0-43eb-4c5f-b9fe-a09d2848db80','Bank':'ad1d77d8-7eb1-4a4c-9173-b0f2f7269644'";
Output the data in section JS code.
But when viewing the source code of the page in the browser, not getting what wanted.
What's the problem? How to make a normal quotes?
JS: "data": "#organizations"
Result in view webpage returned "data": "'Passport':'14f0eac0-43eb-4c5f-b9fe-a09d2848db80','Bank':'ad1d77d8-7eb1-4a4c-9173-b0f2f7269644'"
OK cool Q,try this source:
#{
var model = Model.ToArray().Select(org => string.Format("'{0}':'{1}'", org.Name, org.Id));
var data = string.Join(",", model);
}
#Html.Raw(data)
What if you change
"data": "#organizations"
to
"data": "#Html.Raw(organizations)"
#Html.Raw(content)
And check this one out: http://jeffreypalermo.com/blog/what-is-the-difference-in-lt-variable-gt-and-lt-variable-gt-in-asp-net-mvc/
In your code example here, the culprit is the
#organizations
that generates the quotes. You could instead use:
#Html.Raw(organizations)
Okay, that's great, but by creating JSON, you are doing work the framework could be doing for you. You probably want a model that the framework can serialize for you. This way you don't even need any code in your view header at all.
#Html.Raw(JsonConvert.SerializeObject(Model.ToDictionary(m => m.Name, m => m.Id))))
Above, note that I'm using Json.NET, which you probably want to NuGET into your project because Microsoft is moving to it. No point in figuring out how to use the old JSON serializer to do this. Also note that unless you are using the model for other purposes, you might choose to do the dictionary conversion outside the view, reducing the code-work in the view.
Next, if you are embedding JSON in the view, you might want to consider one of two other options. If the amount of data will be small, consider using the join method proposed by eli (here), but instead encoding it in HTML 5 "data-" elements and loading it using JavaScript. That way you keep javascript out of your view. It's just one more step of confusing when debugging javascript, looking for variables that are initialized by dynamically-generated HTML.
Better yet, create a reusable HTML helper method to transform your model into data attributes: How to use dashes in HTML-5 data-* attributes in ASP.NET MVC
Finally, if there are MANY JSON elements, consider sending the data separately. Render it with a simple Json() method in your controller, and get it with a simple jQuery $.json() in your client-side code. See here for an example
Good luck!

Resources