Home › Forums › Comment box for SharePoint › Changing ThreadID dynamically
Tagged: iFrame
- This topic has 3 replies, 2 voices, and was last updated 9 years ago by
Alexander Bautz.
-
AuthorPosts
-
-
February 28, 2016 at 16:07 #10477
Hello Alex,
I’m trying to figure out what is the best way to accomplish this:
I have a page consisted out of an iFrame and a link Bar. Clicking on each Link updates the src of the iFrame. I do this with some JS function.
What I want is to have the Comments box to show a different Thread for a each link I click.ex: Click on a link “Section A” will display “http://some address/A” in Iframe and will display all comments of thread “Section_A”.
(I couldn’t figure out how to update the cBoxArg Configuration object, maybe JQuery?)Thanks!
-
This topic was modified 9 years, 1 month ago by
kman3d.
-
This topic was modified 9 years, 1 month ago by
-
March 1, 2016 at 23:58 #10528
I’m not sure I understand, but updating an object is just like this:
cBoxArg.ThePropertyYouWantToChange = "the new value";
Alexander
-
March 3, 2016 at 10:16 #10575
-
March 4, 2016 at 20:04 #10619
Hi,
There is no built in method to “kill” the current cBox instance to rewrite it, but you should be able to use this code:// Clear existing cBox $("*[id*=commentBoxInstanse_1").html(""); // Change the placeholderID and threadID cBoxArg.placeholderID = "commentBoxInstanse_2"; cBoxArg.threadID = "commentBoxInstanse_2"+cBoxArg.threadID.split(":")[1]; // reset data object spjs.cBox.data.commentCount = {}; spjs.cBox.data.currDatasetIDArr = {}; spjs.cBox.data.currDatasetLastID = []; spjs.cBox.data.itemData = {}; spjs.cBox.data.settingsObj = {}; // Call function spjs.cBox.init(cBoxArg);
Note the placeholderID “commentBoxInstanse_1” which is the default one, which is changed to “commentBoxInstanse_2”. This means you must have a placeholder for each of the cBox instances on the page.
Hope this helps,
Alexander
-
-
AuthorPosts
- You must be logged in to reply to this topic.