Can someone please help me with this?
On Sun, Sep 16, 2018 at 4:07 PM Srinivas Gadi <[email protected]> wrote:
> am stuck at overriding the default editable bootstrap values in Django
> framework javascript HTML page
>
> In my webpage, it coded as below
>
>
> $.fn.editable.defaults.url = "{% url 'page1' model.PATH %}";
>
>
> Now my requirement is, When I click on a button, it check the
> views.py(page1, which is default URL) and pass the context through 'return
> HttpResponse' to html page that "True" or "False" based the value, if
> false, it should go page2, it never goes to page2 url, its entered to the
> function conflict_warn() but not inside and eventually it failed with
> the,Uncaught
> TypeError:e.getAttribute is not a function I tried number of ways, but
> all are vain.
>
>
> $(this).editable({
> value: "",
> display: false,
> success: function (response, newValue) {
> if (response.hasOwnProperty("State"))){
> conflict_warn(response, newValue)//if State value True,should go to other
> func
> }
> else {
> window.location.href = "{% url 'path1' 'path2'%}" + response;
> }
> },
> error: function(response, newValue) { $(this).editable("destroy"); }
> });
> $(this).editable("submit");
>
>
> function conflict_warn(response, newValue) {
> $(this).editable({
> value: ""
> display: false
> success: function (response.newvalue) {
> window.location.href = "{% url 'path1' 'path2'%}" + response;
> }
> });
> $(this).editable("setValue", "{% url 'page1' model.PATH %}");
> $(this).editable("submit");
> }
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/f27486fd-7b8a-4286-9c3a-25a73f40250d%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/f27486fd-7b8a-4286-9c3a-25a73f40250d%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
Srinivas .G
9966559383
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/CAPC7sphqe6jS4mR_T8MGTb6hOr-d6XSbZMptN6N%3DTwCwEofn%2Bw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.