With capitalization, what are null, true, and false literals in Django templating if tags? - django-templates

With capitalization, what are the Django templating language literals for true, false, and null?
Thanks,

If I understand correctly, it should be True, False and None.

Related

datatables showing incorrect pagination

Pagination should be showing Showing 1 to 11 of 11 entries instead it is showing Showing 1 to 1 of 1 entries. Here is my javascript:
$('.my-dashboard').DataTable({
processing: true,
serverSide: true,
"searching": false,
"lengthChange": false,
ajax: "{{route('dashboard.getWork')}}",
"language": {
"infoFiltered": ""
},
columns: [
{ data: 'title' },
{ data: 'category' }
]
});
This is what is returned
{"draw":1,"iTotalRecords":11,"iTotalDisplayRecords":1,"aaData":[{"title":"Title","category":"1 Youtube Video"}]}
How do i solve?
From the official documentation, see the "returned data" section of this page. That shows the field names which DataTables expects to receive.
There is backwards-compatibility with older legacy field names.
However, that backwards compatibility only works if you use the old version of the DataTables ajax call:
Older versions of DataTables (1.9-) used a different set of parameters to send and receive from the server. As such scripts which are written for DataTables 1.10+ will not be able to function with DataTables 1.9-. However, DataTables 1.10 does have a compatibility mode for scripts written for 1.9-. This compatibility mode is triggered by use of the old sAjaxSource parameter (rather than the new ajax parameter) or by setting $.fn.dataTable.ext.legacy.ajax = true;.
See here for that specific note.
Bottom line: If you can standardize on the new nomenclature, that should resolve this issue.

Downloading the visualization as screenshot and data in ECharts by Baidu

I've been learning how to use ECharts lately, and couldn't figure out how in this example, they have buttons (like this ) on the top right that allow user to download the graph as a screenshot and see the background data.
In some other examples like this, there's no such button, so I'm assuming it's part of ECharts features.
Could anyone, familiar with ECharts, please help explain how to turn those options on? Thank you in advanced for your answers!
Just by browsing around more in these examples, I believe this is what turns on the 'Save As Image', 'Show Data' options (an example usage).
toolbox: {
show : true,
feature : {
mark : {show: true},
dataView : {show: true, readOnly: false},
magicType: {show: true, type: ['line', 'bar']},
restore : {show: true},
saveAsImage : {show: true}
}
},
If anyone has more comprehensive explanation as to what features are available and how to use them, I'd love to learn more and accept it as an answer. Thanks in advance!

Dojo custom language variants

Does Dojo support creation of custom language variants to be used for with Dojo's locale and i18n
Does anyone know if I am able to create a custom language variant for Dojo's locale that works with i18n?.
Example
define({
root: {
greeting: "Hello, world!"
}
"de-myVariant" : true
});
Yes, it can be done. If you have nls/SampleApp.js as:
define({
root: {
greeting: "Hello!"
}
"de" : true,
"de-at": true,
"de-x-mundl": true
});
then there would be three sub-directories under nls:
nls/de
nls/de-at
nls/de-x-mundl
for nls/de/SampleApp.js:
define(({
greeting: "Hallo!"
}));
for nls/de-at/SampleApp.js:
define(({
greeting: "Gruß Gott!"
}));
and for nls/de-x-mundl/SampleApp.js:
define(({
greeting: "Servus, Mundi!"
}));
Then if you config Dojo to get the locale as a URL parameter:
<script src="./dojo/1.8.3/dojo/dojo.js"
data-dojo-config="locale: location.search.substring(1).toLowerCase()">
</script>
you can switch the language easily by passing the locale tag as that parameter:
.../app.html?de-DE
.../app.html?de-at
.../app.html?de-x-Mundl
Note that Dojo considers locale tags as case-sensitive and that's why the input is toLowerCase()ed and internally all the tags are kept in lower-case.

Simple jsfiddle example with dojo 1.8 not working

What is wrong with this simple jsfiddle example using dojo 1.8: http://jsfiddle.net/ractive/qKW2G/3/
The button widget is not loaded on startup, although parseOnLoad is set to true in the data-dojo-config attribute:
data-dojo-config="async: true, parseOnLoad: true"
If you run with async: true, then you need to include the parser and button in the require.
require(["dojo/parser", "dojo/on", "dojo/dom", "dijit/form/Button"],
function(parser, on, dom) {
...
});​
If you run with async: false, then parser and the widgets will be required automatically.

layout:false not working in express.js 3?

i try to skip rendering the layout when rendering a view in express.js. I use jade as my template language. the code i use:
res.render("show", { job: data, layout: false });
any advice? it keeps rendering the layout....
thanks
I am not 100% sure but I think that's the default now.
Otherwise try:
app.set('view options', {
layout: false
});