"Ulysses Almeida" <[EMAIL PROTECTED]> writes: > I'm getting some problems while trying it. First I tried to put the > message on template. And it works fine, but only when we're loading > the grid first time. When we push refresh_link we loose loading > message. Then I tried to use the same method AjaxGrid alredy use ...
You probably missed recreating your div or span or whatever you used. > swapDOM. So I rerwite AjaxGrid.refresh method but now AjaxGrid stops > working and I have JS errors "Erro: dest has no properties > Arquivo-fonte: http://localhost:8080/tg_widgets/turbogears/js/MochiKit.js > Linha: 2928" Are you sure the destination still exists? Haven't you swapped everything out including your placeholder? > --- myajaxgrid.js --- > AjaxGrid.prototype.refresh = function(params) { > /*** > > Refresh the target DOM with new data from the server > > @param params: extra args to append to the request. > Example: > {'sort':'desc', 'offset'=20} > > @rtype: L{Deferred} returning the evaluated JSON response. > > ***/ > > swapDOM(this.target_id, SPAN(null, > BR(null), > "Loading...")); > params = eval(params); > params['tg_random'] = new Date().getTime(); > params['tg_format'] = "json"; > var d = loadJSONDoc(this.refresh_url, params); > d.addCallback(this.updateGrid); > return e; > } > --- cut --- > > Any Idea? Exactly what I said. You're not creating your place holder back. Imagine this: - You have an id 'my_message' - You put your message inside 'my_message' - You swap <span id='my_message' /> with <span /> - WHERE do you put your message next time? You have to create your elements with what you're using to find them, either their name, an attribute, a class or preferably an id... If you can't find them on the DOM tree then you can't replace the right thing. Be seeing you, -- Jorge Godoy <[EMAIL PROTECTED]> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~----------~----~----~----~------~----~------~--~---

