jsTree: how to retrieve 'metadata'? - jquery-plugins

I tried this example, but there is still a problem - I could not get 'metadata' value. Could somebody show one more example?

That example is working fine for me with version 1.0-rc3
Here's another:
{
'attr': {'id': 'example1'},
'data': {
'attr': {
'href': '#'
},
'title': 'Example'
},
'metadata': {
'hello': 'world'
}
}
And to retrieve the metadata:
$(node).data('hello'); // world

Related

How to show a static error page on invalid route in ojet

How to display an error page for an Oracle Ojet application when someone hits an invalid url? If appController.js is where the main routes are defined, how to use to add the invalid hits?
Thanks!
let navData = [
{ path: '', redirect: 'dashboard' },
{ path:'404',detail: { label: '', iconClass: '' }},
{ path: 'about', detail: { label: 'About', iconClass: 'oj-ux-ico-information-s'}}
{path:/.*/,redirect:404,detail:{ label: '', iconClass: '' }}
];

BotFramework - handleTeamsTaskModuleFetch URL not working

Below is the continue task module I am returning. The URL works fine when I hit it directly in the browser, but in teams, I always get this:
Task module reponse
handleTeamsTaskModuleFetch() {
return {
task: {
type: "continue",
value: {
title: "response",
url: `${process.env.HostName}/help.html`,
fallbackUrl: `${process.env.HostName}/help.html`,
width: 500,
height: 500
}
}
};
}
Can anyone see what I am doing wrong?
Cheers
Note: This is how I am creating the Adaptive Card
const adaptiveCard = {
$schema: 'http://adaptivecards.io/schemas/adaptive-card.json',
version: '1.0',
type: 'AdaptiveCard',
body: [{
type: 'TextBlock',
text: 'Task Module Invocation from Adaptive Card',
weight: 'bolder',
size: 3
}],
actions: [{
type: 'Action.Submit',
title: "TEST",
data: { msteams: { type: 'task/fetch'}, data: "meTask" }
}]
}
The URL's domain must be in the app's validDomains array in your app's manifest.

AmCharts hide/ remove categoryField

https://snag.gy/9etSHc.jpg ----- this is the image link with what i need to remove.
const chart = this.AmCharts.makeChart( 'chartavaliacao' + id + idf,
{
'type': 'serial',
'theme': 'light',
'rotate': true,
'colors': colorScheme,
'dataProvider': this.dados,
'graphs': this.grafico,
'marginTop': 10,
'marginLeft': 15,
'marginBottom': 0,
'addClassNames': true,
'valueAxes':[{
'unit': '%',
'maximum': 100,
'minimum': 0,
}],
'categoryField': 'categoria', <<<<<<<<<<<<<<<<<< i need to remove this field from my graph
'titles': [
{
'id': 'Title-1',
'size': 15,
'text': this.grouped ? this.titulo : ''
}
],
'listeners': [{
'event': 'drawn',
'method': modifyAxis
}, {
'event': 'clickGraphItem',
'method': redireciona
}]
}, 10);
}
I need to remove from my graph 'categoryField' but if i comment this show UNDEFINED.
I tryed to put false and e got the same result.
someone can help with this question?
Not knowing what your modifyAxis code does, the safest possible way I can think of that will likely not interfere with it is to use a labelFunction that returns an empty string or single space:
AmCharts.makeChart(..., {
// ...
categoryAxis: {
labelFunction: function() {
return " ";
},
// ...
}
// ...
}

ExtJS: How to hide specific data on store with filtering?

I want to hide a record on Grid that returns from server.
I've setted a filter on store and can reach that specific data but how I'll handle to hide/ignore this record?
fooStore: {
....
filters: [
function(item) {
let me = this;
let theRecord = item.data.status === MyApp.STATUS; //true
if (theRecord) {
console.log(theRecord); //True
console.log("So filter is here!!")
//How to hide/ignore/avoid to load this specific data record to load Grid??
}
}
]
},
Returned JSON;
{
"success": true,
"msg": "OK",
"count": 3,
"data": [
{
//Filter achives to this record and aim to hide this one; avoid to load this record.
"id": 102913410,
"status": "P"
},
{
"id": 98713410,
"status": "I"
},
{
"id": 563423410,
"status": "A"
}
]
}
I can't save my fiddle cause i don't have sencha forum's account so i give you my code :
Ext.application({
name : 'Fiddle',
launch : function() {
var model = Ext.create('Ext.data.Model', {
extend: 'Ext.data.Model',
fields: [
{name: 'id', type: 'int'},
{name: 'status', type: 'string'},
]
});
var store = Ext.create('Ext.data.Store', {
autoLoad: true,
model: model,
proxy: {
type: 'ajax',
url: 'data.json',
reader: {
type: 'json',
rootProperty: 'data'
}
},
filters: [function(item) {
if (item.data.status === "P") {
return true;
}
else {
return false;
}
}],
listeners: {
load: {
fn: function() {
console.log(this.getRange());
}
}
}
});
}
});
Also i create data.json like this :
{
"success": true,
"msg": "OK",
"count": 3,
"data": [{
"id": 102913410,
"status": "P"
}, {
"id": 98713410,
"status": "I"
}, {
"id": 563423410,
"status": "A"
}]
}
I thinks it's near to you'r code and after the loading of the store the filter work as you can this :
Here is sencha fiddle link : https://fiddle.sencha.com/#view/editor
If this can't work, i don't understand what the fuck doing...

Elasticsearch: casting doubles to geo_point. Error with invalid geohash character

I'm getting an error when I run this script to concatenate longitude and latitude doubles into a geo_point.
ElasticsearchIllegalArgumentException[the character \'.\' is not a valid geohash character]
Here's my script for reference:
mappings: {
'index': {
'transform': {
'lang': 'groovy',
'script': "ctx._source['coords'] = [ctx._source['lon'],ctx._source['lat']]"
}
'properties': {
'lon': {
'type': 'double',
},
'lat': {
'type': 'string',
},
'coords': {
'type': 'geo_point',
}
}
}
}
I'd appreciate any help, thanks!
Since you are extracting data from the source, you need to transform strings in to doubles in your groovy script:
new Double(ctx._source['lon']);

Resources