Giter Site home page Giter Site logo

Comments (10)

jorgebastida avatar jorgebastida commented on August 21, 2024

If you know your object name you can use something like "myObject.callback_function" as callback. Dajaxice will execute .... myObject.callback_function(data).

It should work.
Cheers

from django-dajaxice.

amccool avatar amccool commented on August 21, 2024

if I could pass a function reference rather than a string for the function, things would work much easier.

basically replace the 'eval' with execution of the passed func reference.

from django-dajaxice.

amccool avatar amccool commented on August 21, 2024

accidentally closed this

from django-dajaxice.

jorgebastida avatar jorgebastida commented on August 21, 2024

Can you share a workaround to solve this issue ?

from django-dajaxice.

amccool avatar amccool commented on August 21, 2024

let me dig thru the the js code generator, and try a few things

from django-dajaxice.

amccool avatar amccool commented on August 21, 2024

added a check in DajaxiceRequest.py for callback existance (used 'None' if nothing passed)
modified dajaxice.core.js to eval responsetext then directly execute passed callback js func.

I'll add an ExtJS generated callback func test tonight......all in all I'm not seeing any problems

from django-dajaxice.

amccool avatar amccool commented on August 21, 2024

I have a working solution. Whats the best way for me to submit my changes?

from django-dajaxice.

jorgebastida avatar jorgebastida commented on August 21, 2024

If you want, branch dajaxice in github and push the changes, then I can pull the diff.

from django-dajaxice.

Strav avatar Strav commented on August 21, 2024

It would indeed be very nice if the callback could be specified as this.my_method(), directly referring to the current object's local scope. I'll be pulling from amccool's repo for now, in hope to see this change merged and documented soon :)

Thanks the fix!

from django-dajaxice.

jorgebastida avatar jorgebastida commented on August 21, 2024

In the last HEAD version callbacks can be functions and not strings. Old string based callbacks are still supported but will be deprecated soon.

from django-dajaxice.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.