开发者

How do I write the template form in Django if my views.py looks like this?

开发者 https://www.devze.com 2023-02-13 07:19 出处:网络
def ajax_lookup(request,channel): This is one of my views.I am using this to do autocomplete This is the js for it . And I am gettingan obvious error of lesser no. of attributes being s开发者_开发知
def ajax_lookup(request,channel):

This is one of my views.I am using this to do autocomplete

This is the js for it . And I am getting an obvious error of lesser no. of attributes being s开发者_开发知识库ent as I am sending 1 in place of 2. How do I send the second argument ?

<script type="text/javascript">
Ext.onReady(function(){
   {% autoescape off %}

    var searchTable = new GeoNode.MapSearchTable({
        renderTo: 'search_results',
        trackSelection: true,
        permalinkURL: '{% url ajax_lookup %}',
        searchURL: '{% url ajax_lookup %}',
        searchParams: {{init_search}}
    });


    {% endautoescape %}
});
</script>


Might this fix it?

<script type="text/javascript">
Ext.onReady(function(){
   {% autoescape off %}

    var searchTable = new GeoNode.MapSearchTable({
        renderTo: 'search_results',
        trackSelection: true,
        permalinkURL: '{% url views.ajax_lookup channel.id %}',
        searchURL: '{% url views.ajax_lookup channel.id %}',
        searchParams: {{init_search}}
    });


    {% endautoescape %}
});
</script>
0

精彩评论

暂无评论...
验证码 换一张
取 消