- jQuery('.queryeditor-check').click(function() {
- manifold.raise_event(object.options.query_uuid, this.checked?FIELD_ADDED:FIELD_REMOVED, this.value);
- /*
- var column = this.id.substring(6);
- query = data.current_query;
- if (this.checked) {
- if (jQuery.inArray(column, query.fields) == -1) {
- query.fields.push(column);
- jQuery.publish('/query/' + query.uuid + '/changed', query);
- }
- } else {
- query.fields = jQuery.grep(query.fields, function(value) {return value != column;});
- jQuery.publish('/query/' + query.uuid + '/changed', query);
- }
- */
- });
-
- //onFunctionAvailable('jQuery.fn.dataTable', function() {
-
- var nCloneTh = document.createElement( 'th' );
- var nCloneTd = document.createElement( 'td' );
- nCloneTd.innerHTML = "<span class='ui-icon ui-icon-triangle-1-e' style='cursor:pointer'></span>";
- //nCloneTd.innerHTML = '<img src="/components/com_tophat/images/details_open.png">';
- nCloneTh.innerHTML = '<b>Info</b>';
- nCloneTd.className = "center";
- nCloneTh.className = "center";
-
- jQuery('#'+this.options.plugin_uuid+'_fields thead tr').each( function () {
- this.insertBefore( nCloneTh, this.childNodes[0] );
- });
-
- jQuery('#'+this.options.plugin_uuid+'_fields tbody tr').each( function () {
- this.insertBefore( nCloneTd.cloneNode( true ), this.childNodes[0] );
- });
-
- var metaTable = jQuery('#'+this.options.plugin_uuid+'-table').dataTable( {
- bFilter: false,
- bPaginate: false,
- bInfo: false,
- sScrollX: '100%', /* Horizontal scrolling */
- sScrollY: "200px",
- bJQueryUI: true, // Use jQuery UI
- bProcessing: true, // Loading
- aaSorting: [[ 1, "asc" ]], // sort by column fields on load
- aoColumnDefs: [ {"bSortable": false, "aTargets": [ 0 ]},
- { "sWidth": "8px", "aTargets": [ 0 ] },
- { "sWidth": "8px", "aTargets": [ 4 ] }
- ]
- });
-
- jQuery('#'+this.options.plugin_uuid+'_fields tbody td span').live('click', function () {
- var nTr = this.parentNode.parentNode;
- // use jQuery UI instead of images to keep a common UI
- // class="ui-icon treeclick ui-icon-triangle-1-s tree-minus"
- //East oriented Triangle class="ui-icon-triangle-1-e"
- //South oriented Triangle class="ui-icon-triangle-1-s"
-
- if(this.className=="ui-icon ui-icon-triangle-1-e"){
- this.removeClass("ui-icon-triangle-1-e");
- this.addClass("ui-icon-triangle-1-s");
- metaTable.fnOpen( nTr, this.fnFormatDetails(metaTable, nTr, this.options.plugin_uuid+'_div'), 'details' );
- }else{
- this.removeClass("ui-icon-triangle-1-s");
- this.addClass("ui-icon-triangle-1-e");
- metaTable.fnClose( nTr );
- }
- /*
- if ( this.src.match('details_close') ) {
- this.src = "/components/com_tophat/images/details_open.png";
- metaTable.fnClose( nTr );
- }
- else {
- this.src = "/components/com_tophat/images/details_close.png";
- metaTable.fnOpen( nTr, this.fnFormatDetails(metaTable, nTr, this.options.plugin_uuid+'_div'), 'details' );
- }
- */
- });
-
- jQuery('#'+this.options.plugin_uuid+'_fields_wrapper').css({'padding-top':'0em','padding-bottom':'0em'});