none
Jquery sortable function is getting called before calling bing map address validation function for newly entered destination RRS feed

  • Question

  • I have added sortable functionality like bing.com to sort source, destination and newly added destinations using Jquery sortable function. 

    When I add new destination address in a textbox then on "onblur" event of that textbox I am doing address validation for that given address using map.find function and assigning address value that we get in callback function back to the same textbox . e.g. If I enter Irving in the textbox then in the callback function we will get address value as Irving, TX  I am assigning this address value to back to the same textbox.

    But as I am using Jquery sortable function, if user enters some address in destination textbox( C position) and quickly swap that textbox  with second textbox(B position). It is calling sortable function first  and then map.find function which I am calling on "onblur" event of textbox. So because of this, functionality get messed up both B and C position contains same address.

    e.g. If Position A(source) contains address as "Durant, OK" and Position B(destination) contains address as "Plano, TX". Suppose if I add one new destination(Position C) "Irving" and quickly swap that textbox with position B. In this case sortable function gets called first and then map.find function for address validation of "Irving" address. So because of this finally both position B and position C contains same address value "Irving, TX" that we got from callback function of map.find.

     

     

    • Moved by Ricky_Brundritt Saturday, March 10, 2012 10:42 AM (From:Bing Maps: Map Control and Web services Development)
    Monday, September 5, 2011 7:57 AM

Answers

All replies

  • I'm not sure to understand what you want to do but as you refer to map.find, I assume that you are using Bing Maps AJAX V6.3.

    I'm pretty sure that if you want to do address validation, you should consider using the REST Web Service and so you will be able to identify each request and avoid this confusion.

    To help you:

    And here samples that use rest Web Services:


    MVP - Bing Maps - My blog (FR): http://blogs.developpeur.org/nicoboo/ Twitter: http://twitter.com/nicolasboonaert/
    Tuesday, September 6, 2011 2:44 PM
    Moderator
  • okay. Let me explain you in detail.

     

    Suppose If I add start address as "Durant, OK" and end address as "Plano, TX".

    Now I want to add new destination I will click on Add to Route button(like bing map Add to Route feature). I enter address as Irving in textbox C. As I am calling map.find function on "onblur" event of texbox and assigning value that we get in callback function of map.find function back to the same textbox. In this case we would get "Irving, TX" value in the callback function and I am assigning this value back to the same textbox ie. textbox C.  

    but as I am mentioned above in first thread If I drag that textbox C quickly in to 2nd position(So order would be Durant,OK -> Irving, TX - > Plano, TX) then In this case Jquery sortable function gets called first before we assign "Irving, TX" value that we get in callback function back to same textbox. So because of this, finally textbox B and textbox C contains same value.

     

    Tuesday, September 6, 2011 3:47 PM