Kendo TreeList Locked Column Isn't Working - kendo-ui

I have a Kendo TreeList. I'm trying to lock the first column like this:
columns: [
{ field: "field1", title: "Field 1", locked: true },
{ field: "field2", title: "Field 2" }
]
With the locked:true there, however, my TreeList doesn't even load. What might I be missing?

It seems you must specify the field widths in order for column locking to work. In addition, the columns to the right of the locked column(s) must fill up enough width to cause the scrolling to engage.
columns: [
{ field: "field1", title: "Field 1", locked: true, width:200 },
{ field: "field2", title: "Field 2", width: 1000 }
]

Related

How To Display a static measure or column once in webdatarocks

I am creating a Classic layout using rows, column and measure. I want to add a static column( without doing any sum/average) as a last column. How can this be achieved?
Given the following configuration:
"rows": [
{
"uniqueName": "Type",
"sort": "desc"
},
{
"uniqueName": "SubCategory"
}
],
"columns": [
{
"uniqueName": "Month"
},
{
"uniqueName": "Measures"
}
],
"measures": [
{
"uniqueName": "Amount",
"aggregation": "sum",
"format": "02fecc33bec74ccd9c8a0835259938f0"
},
{
"uniqueName": "Budget",
"formula": "min('BudgetAmount') ",
"caption": "Budget"
}
]
How can I display “Budget” column, which is static and will be the same, only once; whilst “Amount” is categorized by “Month”?
Can you please help me with an example incase it can be achieved by creating an additional instance of WebDataRocks to display the “Budget” measure with the desired configuration? I am not sure how this can be done.TIA
There is no built-in solution because, as a general rule, the pivot table approach does not allow adding fixed columns.
As a workaround, you can create the second component with following slice:
slice: {
rows: [{
uniqueName: "Type",
sort: "desc"
},
{
uniqueName: "SubCategory"
},
],
columns: [{
"uniqueName": "[Measures]"
}],
measures: [{
uniqueName: "Budget",
formula: "min('BudgetAmount') ",
caption: "Budget",
}]
}
}

Problem with WebDataRocks Pivot Table captions in rows, columns, measures

I have 3 questions about captions (data localizations):
How to provide caption for a field not included in slice object
Why are captions ignored in: toolbar -> fields -> all fields -> any measure field
Why are captions ignored while adding calculated value: toolbar -> fields -> add calculated value -> any row or column field
Check out this js fiddle
var pivot = new WebDataRocks({
container: "#wdr-component",
toolbar: true,
height: 395,
report: {
dataSource: {
filename: "https://cdn.webdatarocks.com/data/data.csv"
},
"slice": {
"rows": [{
"uniqueName": "Category",
"caption": "Category_Localized"
}
],
"columns": [{
"uniqueName": "Color",
"caption": "Color_Localized"
}],
"measures": [{
"uniqueName": "Price",
"aggregation": "sum",
"caption": "Price_Localized"
}
]
}
}
});
It seems like all these features are currently not working as expected.
As a workaround to the first question though you can simply change the field names in the CSV file you're feeding to the pivot table.

How to make searchable drop-down in adaptive cards

I have a message extension in which one of the Action command shows a form which is basically an adaptive card. The card contains a drop-down.
Here I am interested is there any way to perform the search on the list.
See the image and code below for more clearance.
I am developing in Node.js
const card = CardFactory.adaptiveCard({
version: '1.0.0',
type: 'AdaptiveCard',
body: [
{
"type": "TextBlock",
"text": "Route Name",
"size": "Medium",
"weight": "Bolder",
"spacing": "Large"
},
{
"type": "Input.ChoiceSet",
id: "routeId",
"spacing": "small",
"choices": routedDd,
"placeholder": "Select an option",
"value": "Select an option"
}
],
actions: [
{
type: 'Action.Submit',
title: 'Submit'
}
]
});
return {
task: {
type: 'continue',
value: {
card: card,
heigth: 200,
width: 400,
title: 'Add Task'
}
}
};
I think this feature hasn't yet been released, but it's on the roadmap. See https://www.youtube.com/watch?v=SEsjrFIf110

Retrieve items limited by a field's value inside of a list of objects

I apologise if the title is confusing, but I had a hard time coming up with a good title. :(
I have indexed several news articles that looks like this (shortened):
{
title: "This is definitely a sports article",
categories: [
{
name: "General",
isMain: false,
},
{
name: "Sports",
isMain: true,
}
]
},
{
title: "Slightly sportsrelated, but mostly politics",
categories: [
{
name: "Politics",
isMain: true,
},
{
name: "Sports",
isMain: false,
}
]
}
My problem is that I have to retrieve a list of articles belonging to the "Sports" category, but limited to articles where the "Sports" category's field "isMain" is set to true.
Is that even possible?
(Using Elasticsearch 5.6.6, and I'm unable to reindex and add a "mainCategory" field, unfortunately.)

Is there any way to display multiple datasets without comparing option in amchart?

Here is my fiddle!
I dont want to show compare to block and i tried with making comaparable to false, but this didn't work.
"stockGraphs": [ {
"id": "g1",
"valueField": "value",
"comparable": false,
"compareField": "value",
"balloonText": "[[title]]:<b>[[value]]</b>",
"compareGraphBalloonText": "[[title]]:<b>[[value]]</b>"
} ],
You can set compared to true in your other datasets (ignore the first one as it is always displayed by default) to show the datasets without using the selector:
"dataSets": [ {
"title": "first data set",
"fieldMappings": [ {
"fromField": "value",
"toField": "value"
}, {
"fromField": "volume",
"toField": "volume"
} ],
"dataProvider": chartData1,
//don't set compared in the first dataset or it will be displayed twice
"categoryField": "date"
}, {
"title": "second data set",
"fieldMappings": [ {
"fromField": "value",
"toField": "value"
}, {
"fromField": "volume",
"toField": "volume"
} ],
"dataProvider": chartData2,
"compared": true,
"categoryField": "date"
},
// ... etc
If you want to display the other datasets without the percent change, set recalculateToPercents to "never" in your desired panel(s) or globally in panelsSettings.
Updated fiddle
Edit
If you're looking to just hide the "Compare To": section, add the following CSS:
.amcharts-compare-div {
display: none;
}
/* hide the br tags before and after the dropdown, brining the compare to box up */
.amcharts-data-set-selector-div br:first-child, .amcharts-data-set-selector-div br+select+br, .amcharts-data-set-selector-div br+select+br+br {
display: none;
}
You also need to set the dataSetSelector's compareText property to an empty string.
Updated fiddle

Resources