Dojo Set intermediateChanges on Textarea - dojo

When I use this in Textarea (template String)
`data-dojo-props='intermediateChanges:true' data-dojo-attach-event='onChange : update'`
The onChange event - fires on blur event to Textarea. My requirement is detect the changes once it was made from textarea.
Thanks a lot!

I am not sure how you are creating the Textarea. But, one thing you could try is to make sure the parseOnLoad is set to true or you are using parser.parse();
UPDATE: If the templateString is what you have mentioned in the comments then it wont work. Textarea is a HTML node and not a dijit, so the property intermediateChanges does not apply to it.
Also, dojoAttachPoint and dojoAttachEvent should be data-dojo-attach-point and data-dojo-attach-event. I am surprised that its working for you, may be due to backward compatibility.
The events are case-sensitive for dijits, so you need to make sure it matchs in the template string.
I have working JsBin with TextArea dijit used within a templateString.
https://jsbin.com/cuyigizuji/edit?html,console,output
Hope this was helpful.

Related

Programmatically remove splitter from a Dojo tabContainer

How do I remove a splitter from a dijit tabContainer programmatically?
I have the layout which includes the tabContainer written decoratively in the mark up like so http://jsfiddle.net/kagant15/4o0sfdzd/
I need a js solution that will allow me to remove the an existing splitter,
I've tried the following:
tabContainer.set({splitter : false});
and despite seeing the value set as false after inspecting the element I can still see and use the splitter in the web browser.
Thanks in advance for any help
I see you are talking about removing the splitter from a child of a BorderContainer. It doesn't matter if the child is a TabContainer or some other widget.
Unfortunately the splitter property is const so it's not as simple as tabContainer.set({splitter : false});.
But I think you can do it by calling myBorderContainer.removeChild(tabContainer), then set tabContainer.splitter to false, and finally myBorderContainer.addChild(tabContainer).
If the layout changes after the removeChild()/addChild() you will need to specify a position to addChild(), or specify layoutPriority on all your BorderContainer children.

How to check if element is been dragging with Dojo

What to check if an element is been dragging to make a report of how many times has been dragged, any idea? with dojo of course.
This is the element to be sensed.
<p id="id_number" class="button">Button_name</p>
Please be more clear. I suppose you mean you want to use dojo/dnd/Moveable on your DOM node to make it draggeable? If you look at the API documentation you will notice that it has an event called onDragDetected which will be useful to you. Just increment a counter with it and you're done.

dijit.Menu to be displayed after DOM had been set up

I have set up in Javascript my preferred dijit.Menu which is that far so good.
How am I able to display the dijit.Menu directly after the page starts up in the (with it's position) without any mouse interaction?! I have looked in the API so far and don't find the answers. Will I have to "overwrite" a method?
If yes, which one is it? And what do I have todo???
The widget will not show up until it is parsed by dojo.
You should place fake menu markup inside its dom node:
<div dojoType="dijit.Menu">
<h1>This text is shown after the dom is loaded
and until the menu is parsed and renered</h1>
</div>
As soon as menu is ready, everything you've placed inside menu's dom node will be replaced by actual widget's html.
NON-AMD Version:
dojo.ready(function(){
// The code for all items!
})
DOJO-AMD Version, put the parameters of the modules you like to add, in require as well give them a name in the functions parameters list:
require(["dojo/domReady!"],function(){
//natve code
});

hidden element dojo parsing

How can I avoid the dojo parser showing a hidden element after it's parsed?
<input type="checkbox" dojoType="dijit.form.CheckBox" style="display:none">
When the dojo parser is done, the dijit checkbox will be shown, but the input "inside" it, will still be hidden. I want the dojo parser to create the dijit checkbox, but keep it hidden.
I think that's a limitation of how Dijit works... it's the construction of the widget that's doing this, not the parser per se. The style element gets mapped to the INPUT element, so there is no way to do this short of instantiating the widget directly and hiding it before placing it in the DOM. Updating the style after the parser does its thing would probably result in some unwanted redraws.
I use dijit.layout.BorderContainer with style="height:100%;width:100%;visibility:hidden" and it's working fine for me.

using .aspx page as Jquery Cluetip?

I am using an .aspx page as cluetip bound to an anchor tag. I need to pass a parameter from anchor to this page and then call a WCF service to populate my template with returned JSON. I tried putting body onload function but that doesnt seems to work.
Thanks
Koby.
response to comment
You want to use the .mouseenter() event. This new event in 1.4 is better than .blur() which is what you will see in most examples (and probably why you can find it, a search of blur jquery popup should give you lots of examples). But mouseenter is better in the lastest jQuery
Docs: (very nice example code at the bottom of the page.)
http://api.jquery.com/mouseenter/
old version
just add the function to the onclick handler. You can do this in jquery with something like this
$(selector).click(function () {
code to do stuff (call wcf and populate)
you can use $(this) to see what was clicked on. ("passed" as you put it)
});
see fab new jQuery docs http://api.jquery.com/click/