PATH:
home
/
letacommog
/
letaweb
/
assets
/
1c15cee9
/
js
(function($){ var originalPos = null; var fixHelperDimensions = function(e, tr) { originalPos = tr.prevAll().length; var $originals = tr.children(); var $helper = tr.clone(); $helper.children().each(function(index) { $(this).width($originals.eq(index).width()+1).height($originals.eq(index).height()) .css({ "border-bottom":"1px solid #ddd" }); }); return $helper.css("border-right","1px solid #ddd"); }; /** * Returns the key values of the currently checked rows. * @param id string the ID of the grid view container * @param action string the action URL for save sortable rows * @param column_id string the ID of the column * @param data string the custom POST data * @return array the key values of the currently checked rows. */ $.fn.yiiGridView.sortable = function (id, action, callback, data) { if (data == null) data = {}; var grid = $('#'+id) ; $("tbody", grid).sortable({ helper: fixHelperDimensions, update: function(e,ui){ // update keys var pos = $(ui.item).prevAll().length; if(originalPos !== null && originalPos != pos) { var keys = grid.children(".keys").children("span"); var key = keys.eq(originalPos); var sort = [];//sort number values from to keys.each(function(i) { sort[i] = $(this).attr('data-order'); }); if(originalPos < pos) { keys.eq(pos).after(key); } if(originalPos > pos) { keys.eq(pos).before(key); } originalPos = null; } var sortOrder = {}; keys = grid.children(".keys").children("span"); keys.each(function(i) { $(this).attr('data-order', sort[i]); sortOrder[$(this).text()] = sort[i]; }); data["sortOrder"] = sortOrder; if(action.length) { $.fn.yiiGridView.update(id, { type:'POST', url:action, data:data, success:function(){ grid.removeClass('grid-view-loading'); }, complete:function(){ if($.isFunction(callback)) { callback(sortOrder); } } }); } else if($.isFunction(callback)) { callback(sortOrder); } } }).disableSelection(); }; })(jQuery);
[+]
..
[-] moment.js
[edit]
[-] jquery.sortable.gridview.js
[edit]
[-] bootstrap.responsive.tables.js
[edit]
[-] wysihtml5-0.3.0.js
[edit]
[-] bootstrap-image-gallery.js
[edit]
[-] bootstrap.daterangepicker.js
[edit]
[-] jquery.selectable.gridview.js
[edit]
[-] jquery.saveselection.gridview.js
[edit]
[-] bootstrap-image-gallery.min.js
[edit]
[-] bootstrap-wysihtml5.js
[edit]
[-] markdown.sanitizer.js
[edit]
[-] jquery.stickytableheaders.min.js
[edit]
[-] bootstrap-noconflict.js
[edit]
[-] jquery-ui-no-conflict.min.js
[edit]
[-] markdown.editor.js
[edit]
[+]
fileupload
[-] date.min.js
[edit]
[-] jquery.stickytableheaders.js
[edit]
[-] markdown.converter.js
[edit]
[-] bootstrap.colorpicker.js
[edit]
[-] bootstrap-modalmanager.js
[edit]
[-] moment.min.js
[edit]
[-] jquery.toggle.buttons.js
[edit]
[+]
locales
[-] jquery.timepicker.js
[edit]
[-] jquery.easy.pie.chart.js
[edit]