Change jstree Node Icon via Javascript - jstree

I want to select a specific node from my jstree based on its ID and then change its icon. I want to do this via javascript, and cannot find a basic example on the jstree documentation.
Is it possible?

I think jstree does not offer any API for this. I just looked into an older project and i did it this way:
$divTree.find("li[data-id=" + id + "] > a > ins.jstree-icon").css("background-image", "url(" + iconUrl + ")");
In my case, I identified the node via an attribute data-id. If you directly use IDs, you probably have to adjust the selector to something along the lines of #myId > a > ins.jstree-icon.
Hope this helps!
EDIT
When selecting the node based on its id, try this:
$divTree.find("#" + id + " > a > ins.jstree-icon").css("background-image", "url(" + iconUrl + ")");
probably you could also do this (without performance loss, maybe even performance gain?)
$"#" + id + " > a > ins.jstree-icon").css("background-image", "url(" + iconUrl + ")");

Related

How to get Custom Field Values on a Work Item from Devops API

Is there a way to get the values from custom fields that are on a Work Item in devops via the API?
I've tried both the $expand=all and fields options from the Get Work Items API and couldn't get the data I was looking for. When trying with the fields option, I tried with both name and referencename values from the Fields API without success.
Thanks.
Yes. Use simple "GET WORK ITEM" API:
GET https://dev.azure.com/{organization}/{project}/_apis/wit/workitems/{id}?api-version=6.0
Note, you will only be able to see the custom field (or even any other field) in the JSON response as long as that field has a value stored to it on that work item.
If you just want to get a filed value of specific work item, simply use WIQL and client library.
For example , if your work item have some custom fields and you could try to get these fields by querying with WorkItemCollection, like this:
WorkItemCollection queryResults = workItemStore.Query("Select [State], [Work Item Type], [Title], [Resource Development], [Customize.Complexity.Development] FROM WorkItems " +
"WHERE [Work Item Type] = '" + tipoWorkItem + "' AND [State] <> 'Closed' AND [Team Project] = '" + teamProjectName + "'");
Finally get the custom fields by looping the result, like this:
foreach (WorkItem workItem in queryResults)
{
variable = workItem.Fields["Customize.Resource.Development"].Value;
}
For more details you could also take a look at this similar question: How to get Whats New field value from TFS

Can we pull REXX SQL output values into ISPF panel?

I Have created a REXX program to fetch 3 columns from a table.
I have kept temporary variables to hold SQL values (takes automatic datatype as per input)
Its like:
ADDRESS DSNREXX "EXECSQL FETCH C1 INTO :IN, :CR, :TN"
Now i have created A Panel, but i only know that we assign options.
Which is done like giving
%option_name
But havent got any book or online forum about how to display those REXX program variables to screen.
There are forums only for Calling a panel which have its own functionality.
In ISPF panels, any 8 character rexx variable can be displayed either using the &var. format or prefixing it with a field definition char (say _ for an entry field). e.g.
Rexx:
v1 = '...'
v2 = '..'
v3 = '.'
ISPF Panel:
)body
+ V1 = &v1. Display the value (... will be displayed)
+ v2 :_V2 + Allow the user to update v2
See http://publib.boulder.ibm.com/infocenter/zvm/v5r4/index.jsp?topic=/com.ibm.zvm.v54.dmsa3/ispfpan.htm
Sample ispf panel definition
)BODY
%--------------------------- EMPLOYEE RECORDS ------------------------------
%COMMAND ===>_ZCMD
%
%EMPLOYEE SERIAL: &EMPSER
+
+ TYPE OF CHANGE%===>_TYPECHG + (NEW, UPDATE, OR DELETE)
+
+ EMPLOYEE NAME:
+ LAST %===>_LNAME +
+ FIRST %===>_FNAME +
+ INITIAL%===>_I+
+
+ HOME ADDRESS:
+ LINE 1 %===>_ADDR1 +
+ LINE 2 %===>_ADDR2 +
+ LINE 3 %===>_ADDR3 +
If more than 1 row is being displayed, you may find it useful to
Add the returned rows to a ISPF table
Display the table using the TBDISPL service.
Note: for Table display panels you must include a )Model section for data in the table
If you want to use ISPF Tables see http://rexxpertise.blogspot.com.au/2011/11/ispf-tables-defining-and-building.html for examples of TBCREATE and TBADD
Also for a complicated example ISPF Table
Have a look at question
General ISPF info is available at:
OS/390 V2R5.0-V2R7.0 ISPF Examples
OS/390 V2R10.0 ISPF Dialog Developer's Guide and Reference
OS/390 V2R10.0 ISPF Services Guide

Neo4j Cypher query to find nodes with exact match (AND instead of OR)

I'm trying to create a query that bring me some node that have the exact match with a set of nodes. In this case I wanna bring experiences that have tags, for example, what experiences have tags: "food" AND "nightlife" AND "culture".
My query is "working", but bringing the result using OR instead of AND. How can I fix it?
I'm not sure if I'm using de correct approach of the
#Query("START experience = node:__types__(className=\"...\"), tags = node({0}) " +
"WHERE experience-[:TAGGED]->tags " +
"RETURN experience")
public Set<Experience> findExperiencesByTags(Set<Long> tagIds);
I'm using Spring Data 2.0.1 and neo4j 1.6.3.
try to divide it into 3 separate MATCH phrases:
"MATCH experience-[:TAGGED]->tags1, experience-[:TAGGED]->tags2, experience-[:TAGGED]->tags3, " +
"WHERE tags1.tag='food' AND tags2.tag='culture' AND tags3.tag='nightlife' "
I agree with #ulkas
If you really want to pass in an arbitrary number of tags you can try this, but it will probably perform not as good as the explicit matches.
START tags = node({0})
MATCH experience-[:TAGGED]->tags
WITH experience, count(*) as cnt
WHERE cnt = length({0})
RETURN experience

Powershell controlling MSWord: How to select the entire content and update?

I am dealing with a whole load of Word documents that make heavy use of fields and cross-references (internally and between documents).
To update these and make everything consistent again after a change I have to open each file, select the entire file's content (equivalent of hitting Ctrl-A) and update all fields (the equivalent of hitting F9). And I have to do this twice for all files, so that also all inter-file cross-references are also updated properly.
Since this is a rather tedious and lengthy process I wanted to write me a little PowerShell-script that does that for me. The relevant function to update a file looks like this:
...
function UpdateDoc([object]$word, [object]$fileHandle) {
Write-Host("Updating: '" + $fileHandle.Name + "' ('" + $fileHandle.FullName + "'):")
# open the document:
$doc = $word.Documents.Open($fileHandle.FullName)
# select the entire document:
???
# update it:
???
# then save it:
$doc.Save
$doc.Close
Write-Host("'" + $fileHandle.Name + "' updated.")
}
...
But I am stuck on how to select the file's content and update it all, i.e. what has to go into this code instead of the two ???-markers to achieve what I want?
Did you try:
$doc.Fields | %{$_.Update()}
That should update all the fields

Text Search inside XML nodes with a specific Attribute in DB2 express-C

Have installed DB2 express-C 9.7 on Win7, and am using the DB2 Text Search engine.
I have one requirement to search inside all XML nodes having a specific attribute. Have tried these options:
statement.executeQuery("xquery " +
"for $i in db2-fn:sqlquery(\"SELECT doc FROM orders WHERE CONTAINS(doc, '#xpath:''/order//#key[. contains (\"\"java\"\")]''') = 1\")/order " + "return $i/customer");
statement.executeQuery("xquery " +
"for $i in db2-fn:sqlquery(\"SELECT doc FROM orders WHERE CONTAINS(doc, '#xpath:''/order//#key[.. contains (\"\"java\"\")]''') = 1\")/order " + "return $i/customer");
Here am unsuccessfully trying to search for all those xml documents which have 'java' inside all child elements (of 'order' node) having an attribute 'key'.
May anyone please tell me what should be the right query for this.
Thanks.