[Dojo-interest] how to get focus method on multi select

lukess mail2lokesh at gmail.com
Fri Aug 22 18:10:27 UTC 2008


Thanks Jette, got the idea.

Regards,
Lukes
 

Jette Derriche-2 wrote:
> 
> On Thu, 2008-08-21 at 19:00 -0700, lukess wrote:
>> Hi,
>> 
>>   In my application i am clicking on a node of tree and that node get
>> added
>> to the multi select box, now i want whenever the user clicks on the same
>> node, that value in the select box should get focused. i wrote the  event
>> for that but unable to focus on that value. 
>> 
>> my select box is "queryfiles";
>> 
>> function addnode(item)
>> {
>>    
>>   //some code
>>   var x = item.name[0];
>>    var i = dojo.byId("queryfiles").length;
>>    var flag = true;
>>     for(var j=i-1;j>=0;j--)
>>     {
>>      var temval = dojo.byId("queryfiles").options[j].value;
>> 	 if(temval == x)
>> 	  {
>> 	     flag = false;	
>>              dojo.byId("queryfiles").options[j].focus();
>>              break;
>> 	   }
>>     }
>> 
>> //some more code
>> }
>> Can anyone please tell me how to focus on that value.
> 
> You should instead select the desired value, and then give focus to the
> select box... something like:
> 
> dojo.byId("queryfiles").options[j].selected = true;
> dojo.byId("queryfiles").focus();
> 
> I don't know if the above code is correct, but you get the idea :-)
> 
> /Jette
> 
>> 
>> Thanks in advance.
>> 
>> Regards,
>> Lukes
> 
> _______________________________________________
> FAQ: http://dojotoolkit.org/support/faq
> Book: http://dojotoolkit.org/docs/book
> Forums: http://dojotoolkit.org/forum
> Dojo-interest at dojotoolkit.org
> http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest
> 
> 

-- 
View this message in context: http://www.nabble.com/how-to-get-focus-method-on-multi-select-tp19100160p19112811.html
Sent from the Dojo mailing list archive at Nabble.com.



More information about the Dojo-interest mailing list