我需要在进行javascript测试后显示和隐藏数据表的列,但它不能正常工作.
这是我的测试javascript:
if ( $('#commune_to_display').val()==""){
$('#utable td:nth-child(2)').hide();
$('#commune_to ').hide();
}
Run Code Online (Sandbox Code Playgroud)
此测试仅在数据表的第一页中起作用,在分页之后列仍然可见.
我该如何解决?感谢帮助
我是 javascript 中的变量类型表,我需要if在此变量和 django 数据库中的变量之间使用条件进行测试,但它不起作用。
这个例子 :
var test_date = "2017-06-23";
var locations = [
{% for v in vs %}
{% if v.date == test_date %}
['okok',{{ v.latitude }},{{ v.longitude}}],
{% endif %}
{% endfor%}
]
Run Code Online (Sandbox Code Playgroud)
第一个例子不起作用,我不知道为什么。
另一个例子:
var test_date = "2017-06-23";
var locations = [
{% for v in vs %}
{% if v.date == "2017-06-23" %}
['okok',{{ v.latitude }},{{ v.longitude}}],
{% endif %}
{% endfor%}
]
Run Code Online (Sandbox Code Playgroud)
当我将变量的值放入测试中时,它正在工作