开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜