Question

I am exploring the 'JavaScript API for Office' but it look like very limited abilities here :( !! so as for now I was able to make placeHolders [1],[2].... in my document upon the users locate the cursor then press a button in my taskPane, so I build textarea in the taskPane which is related to this placeHolder and so on (this is bindings, which working just fine)

my problem now, is that I want to show/hide those textboxes upon user selections, so if user select placeholder [1] then I show only textbox1 (textbox or textarea same) and so on, Actually I was able to do this by using

 var num = String(eventArgs.binding.id).split("_")[String(eventArgs.binding.id).split("_").length-1]
        document.getElementById("txt"+num).style.display = "block";

in onBindingSelectionChanged event handler

but the problem comes as what if user select many placeHolders [1][2], in this case I should show all relative textboxes (textbox1,textbox2) but I can't find something like Office.context.document.bindings[i].selected

if this property .selected is available for the bindings then my problem will be solved, as i will iterate through all bindings and show any binding with selected = true

so any clue??

also I hoep to find any clue for the location of those placeHolders as I want to move the textboxes in the taskPane to be in the same location of there relative placeholders (horizontally)

Thank you all, happy coding...

Était-ce utile?

La solution

Amr

I'm not sure what you mean by "placeHolder". Could you clarify that?

It sounds like you're trying to get the Binding that the user selects. Is that right? In order to do that, you should subscribe to the BindingSelectionChanged event. The event arguments will include the current selected Binding.

Here's the reference page for that part of the API: http://msdn.microsoft.com/en-us/library/office/fp161088.aspx

-Michael

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top