Loading ...
Sorry, an error occurred while loading the content.
 

Re: [ydn-javascript] ContextMenu not work after a callback

Expand Messages
  • Satyam
    I can t say for sure without a look at the code, but something that often happens is that the element that triggers the context view into visibility is
    Message 1 of 2 , Jun 28, 2008
      I can't say for sure without a look at the code, but something that
      often happens is that the element that triggers the context view into
      visibility is completely redrawn, that is, the original element is
      deleted and a new one takes its place. The context menu is completely
      unaware of such swap and remains listening to an element that no longer
      exists.

      From what you are saying I understand that for each add/delete row you
      are redrawing the table completely from data coming from the server.
      This is not the best way to do it. When you delete a row, it is best to
      send a message to the server identifying the row to be deleted and upon
      receiving an acknowledgment back from the server, you call method
      deleteRow, likesyse, when you insert a row, you just tell the server and
      do an addRow when the Ok from the server is received, possibly along any
      extra data such as autoincrement fields or variable defaults. This
      would probably solve your context menu issue since the table would not
      be redrawn and the context menu would not get its trigger missing.

      Satyam

      giuseppe.filice wrote:
      > Hi to all,
      > i made a datatable with a context menu that trigger some action (add a
      > new row in db, delete a row, etc.) by a callback to php pages.
      > The first time that i load the page all is ok (the event triggered
      > add/delete a row in database).
      > Then i call the function that rebuild the datatable and now the
      > contextmenu is rendered but i can't select any option.
      > If i reload the page it work.
      >
      > Anyone can help me?
      >
      > Thanks in advance
      >
      >
      > ------------------------------------
      >
      > Yahoo! Groups Links
      >
      >
      >
      > ------------------------------------------------------------------------
      >
      >
      > No virus found in this incoming message.
      > Checked by AVG.
      > Version: 8.0.101 / Virus Database: 270.4.1/1522 - Release Date: 27/06/2008 8:27
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.