[CLOSED] Call Server DirectEvent from ExtJs

  1. #1

    [CLOSED] Call Server DirectEvent from ExtJs

    Hi,

    This question is related to this: http://forums.ext.net/showthread.php...ll=1#post98393

    After I make SetValue on store of remote combobox I need to call OnDirectSelect event to make some things on serverside.

    How can I call DirectEvent from ExtJs in my situation or what solution can you suggest for me?


    Thanks,
    ViDom
    Last edited by Daniil; Apr 12, 2013 at 1:36 PM. Reason: [CLOSED]
  2. #2
    Hi @ViDom,

    You could try with the fireEvent method.
    http://docs.sencha.com/ext-js/3-4/#!...thod-fireEvent

    Another approach is using a Select Listener + a DirectMethod instead of a DirectSelectEvent.
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi @ViDom,

    You could try with the fireEvent method.
    http://docs.sencha.com/ext-js/3-4/#!...thod-fireEvent

    Another approach is using a Select Listener + a DirectMethod instead of a DirectSelectEvent.
    I had tryed make it like this:
    Ext.Net.X.Js.AddScript("combo1.fireEvent(\"combo1_OnDirectSelect\",null);");
    but it doesn't work.
    Am I doing something wrong?
  4. #4
    Please try:
    Ext.Net.X.Js.AddScript("combo1.fireEvent('select');");
  5. #5
    Quote Originally Posted by Daniil View Post
    Please try:
    Ext.Net.X.Js.AddScript("combo1.fireEvent('select');");
    Javascript has specific approach for most of thing(speaking as .net developer).

    That's work by second time. At Add first item nothing happend there's nothing selected. Is there a way to make a delay for call event?
  6. #6
    Quote Originally Posted by ViDom View Post
    At Add first item nothing happend there's nothing selected. Is there a way to make a delay for call event?
    Sorry, I don't quite understand it. Please provide a test case.
  7. #7
    Quote Originally Posted by Daniil View Post
    Sorry, I don't quite understand it. Please provide a test case.
    Sorry for confuse.

    event fire at first time but there is nothing selected yet. because all script looks like:
    Ext.Net.X.Js.AddScript("combo1.getStore().reload({callback: function () { combo1.setValue(2);}});/*here need delay */combo1.fireEvent('select');");
    I assumed that store doesn't reload yet but event has got fire. Are it's clear now?
  8. #8
    Do not you need to call the fireEvent within the callback function? By the way, there is the setValueAndFireSelect method.

    So, I would try the following.
     Ext.Net.X.Js.AddScript("combo1.getStore().reload({callback:  function () { combo1.setValueAndFireSelect(2);}});");
  9. #9
    Quote Originally Posted by Daniil View Post
    Do not you need to call the fireEvent within the callback function? By the way, there is the setValueAndFireSelect method.

    So, I would try the following.
     Ext.Net.X.Js.AddScript("combo1.getStore().reload({callback:  function () { combo1.setValueAndFireSelect(2);}});");
    Yes you right @Daniil:) this works like a charm:)

    Thanks again.

    Thread can be closed.

Similar Threads

  1. Replies: 7
    Last Post: Sep 02, 2016, 7:47 PM
  2. Replies: 4
    Last Post: Apr 09, 2013, 4:03 PM
  3. [CLOSED] Call remote WebService via DirectEvent
    By macap in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: May 06, 2011, 1:44 PM
  4. Call C# server method by javascript
    By joao.msdn in forum 1.x Help
    Replies: 1
    Last Post: May 25, 2010, 2:20 AM
  5. [CLOSED] Server side call inside of tag
    By Yevgeniy in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Mar 29, 2010, 3:58 PM

Tags for this Thread

Posting Permissions