Spotfire JQuery: Data Function updates document property, JQuery on change Event not called












0














I have a data function that updates a document property. The property is a string of HTML code. The string is an HTML mockup of an unordered list. When ever the data function updates the document property, my javascript code to take that document property's value and put it into a div's html isn't fired. The on change function that does that process is only fired when I click the input box and put an extra space or something...



In the end I want to hide the input box and just display the div containing the document property formatted as html.



( I'm using an input box instead of a label since the javascript worked better for me)



This is what I want...




  1. datafunction runs and updates document property

  2. javascript realizes the document property has changed and runs (without user interacting with the document property's field)


here is my code...



HTML/CSS



<style>
ul li {
color: black;
list-style: none;
font-size: 1.5em;
padding: 5px 0px;
}

ul li::before {
color: rgb(227,114,34);
content: "2022";
font-size: 1.5em;
padding-right: 1.1225em;

position: relative;
top: 0em;
}
</style>
<DIV id="analysis"><SpotfireControl id="03f5066b000f41babdcb3807ec8fca41" />
</DIV>
<DIV id="preview"></DIV>


JAVASCRIPT



$("#analysis input").bind('input propertychange',livePreview);
$("#analysis input").on('change',livePreview);

function livePreview(){
$("#preview").html($("#analysis input").val())
}


here is an example of the document property value



<ul><li>Line 1</li><li>Line 2</li><ul><li>Line 3 indented</li><li>Line 4 indented</li></ul><li>line 5</li><li>line 6</li></ul>









share|improve this question






















  • Have you tried this: developer.mozilla.org/en-US/docs/Web/API/MutationObserver
    – Mark P.
    Nov 27 at 18:21










  • I ended up using an Iron Python Script to do what I was wanting to do rather than a datafunction. In the script I set the HTML to the Text area in the script rather than having javascript do it.
    – M. Stolte
    Dec 5 at 15:13
















0














I have a data function that updates a document property. The property is a string of HTML code. The string is an HTML mockup of an unordered list. When ever the data function updates the document property, my javascript code to take that document property's value and put it into a div's html isn't fired. The on change function that does that process is only fired when I click the input box and put an extra space or something...



In the end I want to hide the input box and just display the div containing the document property formatted as html.



( I'm using an input box instead of a label since the javascript worked better for me)



This is what I want...




  1. datafunction runs and updates document property

  2. javascript realizes the document property has changed and runs (without user interacting with the document property's field)


here is my code...



HTML/CSS



<style>
ul li {
color: black;
list-style: none;
font-size: 1.5em;
padding: 5px 0px;
}

ul li::before {
color: rgb(227,114,34);
content: "2022";
font-size: 1.5em;
padding-right: 1.1225em;

position: relative;
top: 0em;
}
</style>
<DIV id="analysis"><SpotfireControl id="03f5066b000f41babdcb3807ec8fca41" />
</DIV>
<DIV id="preview"></DIV>


JAVASCRIPT



$("#analysis input").bind('input propertychange',livePreview);
$("#analysis input").on('change',livePreview);

function livePreview(){
$("#preview").html($("#analysis input").val())
}


here is an example of the document property value



<ul><li>Line 1</li><li>Line 2</li><ul><li>Line 3 indented</li><li>Line 4 indented</li></ul><li>line 5</li><li>line 6</li></ul>









share|improve this question






















  • Have you tried this: developer.mozilla.org/en-US/docs/Web/API/MutationObserver
    – Mark P.
    Nov 27 at 18:21










  • I ended up using an Iron Python Script to do what I was wanting to do rather than a datafunction. In the script I set the HTML to the Text area in the script rather than having javascript do it.
    – M. Stolte
    Dec 5 at 15:13














0












0








0







I have a data function that updates a document property. The property is a string of HTML code. The string is an HTML mockup of an unordered list. When ever the data function updates the document property, my javascript code to take that document property's value and put it into a div's html isn't fired. The on change function that does that process is only fired when I click the input box and put an extra space or something...



In the end I want to hide the input box and just display the div containing the document property formatted as html.



( I'm using an input box instead of a label since the javascript worked better for me)



This is what I want...




  1. datafunction runs and updates document property

  2. javascript realizes the document property has changed and runs (without user interacting with the document property's field)


here is my code...



HTML/CSS



<style>
ul li {
color: black;
list-style: none;
font-size: 1.5em;
padding: 5px 0px;
}

ul li::before {
color: rgb(227,114,34);
content: "2022";
font-size: 1.5em;
padding-right: 1.1225em;

position: relative;
top: 0em;
}
</style>
<DIV id="analysis"><SpotfireControl id="03f5066b000f41babdcb3807ec8fca41" />
</DIV>
<DIV id="preview"></DIV>


JAVASCRIPT



$("#analysis input").bind('input propertychange',livePreview);
$("#analysis input").on('change',livePreview);

function livePreview(){
$("#preview").html($("#analysis input").val())
}


here is an example of the document property value



<ul><li>Line 1</li><li>Line 2</li><ul><li>Line 3 indented</li><li>Line 4 indented</li></ul><li>line 5</li><li>line 6</li></ul>









share|improve this question













I have a data function that updates a document property. The property is a string of HTML code. The string is an HTML mockup of an unordered list. When ever the data function updates the document property, my javascript code to take that document property's value and put it into a div's html isn't fired. The on change function that does that process is only fired when I click the input box and put an extra space or something...



In the end I want to hide the input box and just display the div containing the document property formatted as html.



( I'm using an input box instead of a label since the javascript worked better for me)



This is what I want...




  1. datafunction runs and updates document property

  2. javascript realizes the document property has changed and runs (without user interacting with the document property's field)


here is my code...



HTML/CSS



<style>
ul li {
color: black;
list-style: none;
font-size: 1.5em;
padding: 5px 0px;
}

ul li::before {
color: rgb(227,114,34);
content: "2022";
font-size: 1.5em;
padding-right: 1.1225em;

position: relative;
top: 0em;
}
</style>
<DIV id="analysis"><SpotfireControl id="03f5066b000f41babdcb3807ec8fca41" />
</DIV>
<DIV id="preview"></DIV>


JAVASCRIPT



$("#analysis input").bind('input propertychange',livePreview);
$("#analysis input").on('change',livePreview);

function livePreview(){
$("#preview").html($("#analysis input").val())
}


here is an example of the document property value



<ul><li>Line 1</li><li>Line 2</li><ul><li>Line 3 indented</li><li>Line 4 indented</li></ul><li>line 5</li><li>line 6</li></ul>






javascript jquery spotfire






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 15 at 22:52









M. Stolte

84




84












  • Have you tried this: developer.mozilla.org/en-US/docs/Web/API/MutationObserver
    – Mark P.
    Nov 27 at 18:21










  • I ended up using an Iron Python Script to do what I was wanting to do rather than a datafunction. In the script I set the HTML to the Text area in the script rather than having javascript do it.
    – M. Stolte
    Dec 5 at 15:13


















  • Have you tried this: developer.mozilla.org/en-US/docs/Web/API/MutationObserver
    – Mark P.
    Nov 27 at 18:21










  • I ended up using an Iron Python Script to do what I was wanting to do rather than a datafunction. In the script I set the HTML to the Text area in the script rather than having javascript do it.
    – M. Stolte
    Dec 5 at 15:13
















Have you tried this: developer.mozilla.org/en-US/docs/Web/API/MutationObserver
– Mark P.
Nov 27 at 18:21




Have you tried this: developer.mozilla.org/en-US/docs/Web/API/MutationObserver
– Mark P.
Nov 27 at 18:21












I ended up using an Iron Python Script to do what I was wanting to do rather than a datafunction. In the script I set the HTML to the Text area in the script rather than having javascript do it.
– M. Stolte
Dec 5 at 15:13




I ended up using an Iron Python Script to do what I was wanting to do rather than a datafunction. In the script I set the HTML to the Text area in the script rather than having javascript do it.
– M. Stolte
Dec 5 at 15:13

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53328995%2fspotfire-jquery-data-function-updates-document-property-jquery-on-change-event%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53328995%2fspotfire-jquery-data-function-updates-document-property-jquery-on-change-event%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Biblatex bibliography style without URLs when DOI exists (in Overleaf with Zotero bibliography)

ComboBox Display Member on multiple fields

Is it possible to collect Nectar points via Trainline?