git://git.onelab.eu
/
myslice.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
get initial display to behave as expected
[myslice.git]
/
plugins
/
querytable
/
static
/
js
/
querytable.js
diff --git
a/plugins/querytable/static/js/querytable.js
b/plugins/querytable/static/js/querytable.js
index
42dfee5
..
a217657
100644
(file)
--- a/
plugins/querytable/static/js/querytable.js
+++ b/
plugins/querytable/static/js/querytable.js
@@
-7,7
+7,9
@@
(function($) {
var debug=false;
(function($) {
var debug=false;
-// debug=true
+ debug=true
+ var debug_deep=false;
+// debug_deep=true;
var QueryTable = Plugin.extend({
var QueryTable = Plugin.extend({
@@
-76,19
+78,20
@@
var all_columns = this.options.columns; // .concat(this.options.hidden_columns)
for (c in all_columns) {
var column=all_columns[c];
var all_columns = this.options.columns; // .concat(this.options.hidden_columns)
for (c in all_columns) {
var column=all_columns[c];
- this.slick_columns.push ( {id:column, name:column, field:column });
+ this.slick_columns.push ( {id:column, name:column, field:column
, width:100, minWidth:40,
});
}
// xxx should be extensible from caller with this.options.slickgrid_options
this.slick_options = {
enableCellNavigation: false,
enableColumnReorder: true,
}
// xxx should be extensible from caller with this.options.slickgrid_options
this.slick_options = {
enableCellNavigation: false,
enableColumnReorder: true,
+ explicitInitialization: true,
};
this.slick_data=[];
var selector="#grid-"+this.options.domid;
};
this.slick_data=[];
var selector="#grid-"+this.options.domid;
- if (debug) {
+ if (debug
_deep
) {
messages.debug("slick grid selector is " + selector);
for (c in this.slick_columns) {
var col=this.slick_columns[c];
messages.debug("slick grid selector is " + selector);
for (c in this.slick_columns) {
var col=this.slick_columns[c];
@@
-117,7
+120,7
@@
}, // getColIndex
checkbox_html : function (key, value) {
}, // getColIndex
checkbox_html : function (key, value) {
-
// if (debug
) messages.debug("checkbox_html, value="+value);
+
if (debug_deep
) messages.debug("checkbox_html, value="+value);
var result="";
// Prefix id with plugin_uuid
result += "<input";
var result="";
// Prefix id with plugin_uuid
result += "<input";
@@
-160,7
+163,7
@@
},
set_checkbox: function(record, checked) {
},
set_checkbox: function(record, checked) {
- console.log("set_checkbox not
implemente
d");
+ console.log("set_checkbox not
yet implemented with slickgri
d");
return;
/* Default: checked = true */
if (checked === undefined) checked = true;
return;
/* Default: checked = true */
if (checked === undefined) checked = true;
@@
-190,7
+193,7
@@
checkbox_id = escape_id(checkbox_id);
// using dataTables's $ to search also in nodes that are not currently displayed
var element = this.table.$(checkbox_id);
checkbox_id = escape_id(checkbox_id);
// using dataTables's $ to search also in nodes that are not currently displayed
var element = this.table.$(checkbox_id);
- if (debug)
+ if (debug
_deep
)
messages.debug("set_checkbox checked=" + checked
+ " id=" + checkbox_id + " matches=" + element.length);
element.attr('checked', checked);
messages.debug("set_checkbox checked=" + checked
+ " id=" + checkbox_id + " matches=" + element.length);
element.attr('checked', checked);
@@
-333,10
+336,15
@@
on_all_query_done: function() {
if (debug) messages.debug("1-shot initializing dataTables content with " + this.slick_data.length + " lines");
on_all_query_done: function() {
if (debug) messages.debug("1-shot initializing dataTables content with " + this.slick_data.length + " lines");
+ var start=new Date();
this.slick_grid.setData (this.slick_data, true);
this.slick_grid.setData (this.slick_data, true);
- if (debug)
+ this.slick_grid.init();
+ var duration=new Date()-start;
+ if (debug) messages.debug("setData+render took " + duration + " ms");
+ if (debug_deep) {
+ // show full contents of first row app
for (k in this.slick_data[0]) messages.debug("slick_data[0]["+k+"]="+this.slick_data[0][k]);
for (k in this.slick_data[0]) messages.debug("slick_data[0]["+k+"]="+this.slick_data[0][k]);
- this.slick_grid.render();
+ }
var self = this;
// if we've already received the slice query, we have not been able to set
var self = this;
// if we've already received the slice query, we have not been able to set