Datatables.responsive.js crashes when Datatable has no rows - responsive-design

As per title, I have a Datatable, that loads data using the ajax options. This works fine.
When I add the responsive extension Version 1.01, it works as expected when I resize the browser EXCEPT when my datatable has no rows.
datatable.responsive.js crashes at line 561:
var clone = dt.row( idx ).node().cloneNode( true );
with error:
Microsoft JScript runtime error: 'dt.row(...).node()' is null or not an object
I am simply adding the line:
responsive: true,
to my Datatable defintion as follows:
$('#tableName').dataTable({
processing: true,
pagingType: "full_numbers",
serverSide: true,
responsive: true,
columns: [
{ name: "ID" },
{ name: "ColumnName1" },
...more columns
],
ajax: "MyURL"
});
});

This has been fixed as part of this release

Related

flowplayer playlist track auto change is giving error

I am using Flowplayer(in Mean js audio streaming project) for RTMP audio streaming with Wowza streaming engine software and using below service of angular js.
app.service('flowPlayerService', ['$cookies','constant',function ($cookies,constant) {
player: null,
currentTitle:'',
constructPlaylist: function (playlist) {
var currentObj = this;
this.player = flowplayer("flashPlayer", "lib/flowplayer/flowplayer-3.2.18.swf", {
playlist:playlist,
onBegin: function(talk){
console.log('clip changed');
},
onFail:function(){
//alert('loading failed');
},
onFinish:function(){
console.log('finisheds');
},
// engine:'html5',
// Specify the location of the RTMP plugin.
plugins: {
rtmp: {
url: 'lib/flowplayer/flowplayer.rtmp-3.2.13.swf',
netConnectionUrl: 'rtmp://10.10.3.11/vod'
},
controls: {
autoHide: 'never',
url: 'lib/flowplayer/flowplayer.controls-3.2.16.swf',
tooltips: {
buttons: true,
fullscreen: false,
pause: 'Continue playing',
},
playlist: true,
fullscreen:false,
},
dock: {
enabled:false,
gap: 5,
autoHide: false
}
},
onMouseOut:function(){
console.log('mouse out');
}
//canvas: {backgroundGradient: 'none'}
});
console.log(this.player);
//this.player = flowplayer();
},
}
While playing single track it is working fine.But when I try to run playlist first track plays file but when first track finished it gives error like:-
VM36229:1 [ERROR] time 13:51:35.968 :: 201, Unable to load stream or clip file, cannot play video: Error #2154, clip: '[Clip] 'mp3:02 Jashn-E-Bahaara-1469775940586.mp3''
below playlist array example:-
[{
url:"mp3:track.mp3",
provider:"rtmp",
title:'track title'
},
{
url:"mp3:track1.mp3",
provider:"rtmp",
title:'track title1'
}
]
please help.
Passing the "duration" to clip objects resolve this issue.

Set criteria in query for fields and fields in nested objects

I have a document like this:
{
"InDate": "11.09.2015",
"Kst2Kst": true,
"OutDate": "11.09.2015",
"__v": 0,
"_id": ObjectId('55f2df2d7e12a9f1f52837e6'),
"accepted": true,
"inventar": [
{
"accepted": "1",
"name": "AAAA",
"isstammkost": true,
"stammkost": "IWXI"
},
{
"accepted": "1",
"name": "BBBB",
"isstammkost": false,
"stammkost": "null"
}
]
}
I want to select the data with "isstammkost": true in the inventar-array.
My query is:
Move.findOne({accepted : true, 'inventar.isstammkost' : true},
'OutDate InDate inventar.name', function(err, res)
It doesn't work -> It selects all, even with inventar.isstammkost : false.
The "normal" query works like I want (without criteria in sub-array). Whats the right way to set criteria in sub-array?
Of course it will return the "isstammkost": false part, because that is part of the same document as the "isstammkost": true. They are both objects in the array "inventar", a top-level field in a single document. Without some sort of projection, the entire document will always be returned to a mongodb query and thus nodejs will pass them on to you.
I'm not terribly up-to-speed on nodejs, but if this were the mongo shell it would look like this:
> db.MyDB.findOne({{accepted : true, "inventar.isstammkost" : true}, {"inventar.isstammkost.$": 1});
You will need to find out how to add that extra parameter to the nodejs function.

Uncaught Rally.data.ModelFactory.getModel(): Could not find registered factory for type: milestone

Trying to display Milestone for each release, but when trying to create DataStore for Milestone getting error
Uncaught Rally.data.ModelFactory.getModel(): Could not find registered factory for type: milestone
below is my code any ideas or suggestions on this
_getMileStones: function(startDate, endDate, project_id) {
var startDateFilter = Ext.create('Rally.data.QueryFilter', {
property: 'TargetDate',
operator: '>',
value: startDate
});
startDateFilter = startDateFilter.and({
property: 'TargetDate',
operator: '<',
value: endDate
});
startDateFilter = startDateFilter.and({
property: 'TargetDate',
operator: '!=',
value: null
});
startDateFilter = startDateFilter.and({
property: 'TargetDate',
operator: '!=',
value: null
});
var filters = startDateFilter;
Ext.create('Rally.data.wsapi.Store',{
model: 'milestone',
autoLoad: true,
filters: filters,
context: {
project: project_id,
projectScopeDown: true,
projectScopeUp: false
},
fetch: ['Name','FormattedID','DisplayColor'],
listeners: {
load: function(store,records) {
console.log("records values", records);
}
}
}, this);
},
The current stable rc3 release candidate of AppSDK2 predates milestones. They are not available in rc3. When I use rc3 I get the same error you get. If I switch to "x", in the app's config file, and use rab build to rebuild the app, the error goes away:
{
"name": "myapp",
"className": "CustomApp",
"server": "https://rally1.rallydev.com",
"sdk": "x",
"javascript": [
"App.js"
],
"css": [
"app.css"
]
}
Generally it is not recommend using "x" because it is constantly changes. It is not a stable version. But as long as you know that, you may use "x". The AppSDK next release may not be too far in the future, and it will include support for Milestones.
UPDATE: AppSDK2.0 GA has not been announced yet, but it is expected to be released soon. If you use "sdk":"2.0" you get Milestone data.
"x" returns Milestones, but it is a head version that is subject to constant changes. 2.0rc3 does not have Milestones.
You may choose to use 2.0 even though it is not formally available yet.
This app example:
Ext.define('CustomApp', {
extend: 'Rally.app.App',
componentCls: 'app',
launch: function() {
Ext.create('Rally.data.wsapi.Store',{
model: 'milestone',
autoLoad: true,
fetch: ['Name'],
listeners: {
load: function(store,records) {
console.log("records values", records);
}
}
}, this);
}
});
Along with this config:
{
"name": "milestones",
"className": "CustomApp",
"server": "https://rally1.rallydev.com",
"sdk": "2.0",
"javascript": [
"App.js"
],
"css": [
"app.css"
]
}
will return milestone data:

Sencha Touch and MathJax

I am trying to display math-equations in a Sencha view component (extends: Ext.Container), using a Ext.Label Component and MathJax JS. (As was suggested answering my other question: Display math symbols in Ext.js / Sencha Touch)
This is the initialization of the view component:
Ext.define('TIQuiz3.view.Question', {
extend: 'Ext.Container',
...
requires: ['Ext.Label', ...],
config: {
fullscreen: true,
...
layout: {
type: 'vbox',
align: 'stretch'
}
},
initialize: function() {
this.callParent();
...
var questionLabel = {
xtype: 'label',
style: {
'border':'1px solid black',
'background':'white'
},
margin: 10,
padding: 10,
html: "<div>Es sei $L = \{011, 01, 11, 100\}$ \"uber dem Alphabet $\Sigma = \{0,1\}$.</div>",
flex: 1
};
...
this.add([...,questionLabel,...]);
}
I have included a local copy of MathJAX in the app.json file:
"js": [
{
"path": "touch/sencha-touch.js",
"x-bootstrap": true
},
{
"path": "bootstrap.js",
"x-bootstrap": true
},
{
"path": "resources/mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML",
"update": "delta"
},
{
"path": "app.js",
"bundle": true, /* Indicates that all class dependencies are concatenated into this file when build */
"update": "delta"
}
],
MathJax indicates to be loaded successfully.
But the output of the label does not display math properly. Instead it simply looks like this:
Es sei $L = {011, 01, 11, 100}$ "uber dem Alphabet $Sigma = {0,1}$.
Is displaying math with MathJax and HTML possible using a Sencha Label Component?
Any advice appreciated!
Thanks,
Thomas
Ok, thanks Peter, that brought me to the solution.
The problem was indeed the rendering of the content after the onload-event of the page.
For these cases MathJax holds a method to invoke the typesetting manually at a later time. So what I did was adding the following afterPainted-Listener to the rendered view component:
listeners : {
order : 'after',
painted : function() {
MathJax.Hub.Queue(["Typeset",MathJax.Hub]);
}
}
Note that, as Peter pointed out, in order for the upper to work one has to configure $ to be accepted as math delimiter from MathJax - which is not default behaviour.
Thanks for the advice!

Django database introspection

I'd like to introspect the Django database(or table) at the runtime. So, for example- I'd like to do something like:
>>> a = django.db.introspect()
and now *a* should see like
a = {
'table_name1':{
'column_name_1_1':{
'index': True,
'unique': True,
'pk': True
},
'column_name_1_2':{
'index': True,
'unique': False,
'pk': False
}
},
'table_name2':{
'column_name_2_1':{
'index': True,
'unique': True,
'pk': True
},
'column_name_2_2':{
'index': True,
'unique': False,
'pk': False
}
}
}
And- I'd like to do that with Django & South and without any 3rd party tools(I know that I coul do that with SQLAlchemy). I want to introspect the actual db, not the frozen one in my last migration. Is that possible? How can I start?
I've found my answer- here is everything I need:
https://code.djangoproject.com/browser/django/trunk/django/core/management/commands/inspectdb.py

Resources