The question of how many columns are displayed for the JQuery gridly control.

Source: Internet
Author: User

The question of how many columns to display for the JQuery gridly control is displayed exactly according to the value of columns.

But showing columns is not a few columns for how many values to display. is still very vague at the moment. The official document does not give a specific explanation.

$ ('. gridly '). gridly ({base:60,//pxgutter:20,//Pxcolumns: $ ("#FormColumnCount"). Val () * 3,callbacks: {reordered:func tion ($elements) {//called after the drag and drop ends with the elements in their ending position.//current object var currentobj = This.reordered.arguments[1];var arr = $elements;//Previous object Var prevobj;//after an object var afterobj;for (i = 0; i < arr.length; i++) {$ (arr[i]). Find (' Input[name=sortby] '). Val ((i + 2) * 10);} Perform save sort, update data//sortdata ...}});

  

The code for determining the coordinates is as follows:

   Gridly.prototype.position = function ($element, columns) {      var column, height, I, j, K, Max, ref, REF1, Ref2, size;
   
    size = This.size ($element);      Height = Infinity;      column = 0;      for (i = j = 0, ref = columns.length-size; 0 <= ref. J < ref:j > ref; i = 0 <= ref? ++J:--j) {        max = Math.max.apply (Math, Columns.slice (i, i + size));        if (max < height) {          height = max;          column = i;        }      }      for (i = k = ref1 = column, ref2 = column + size; ref1 <= ref2? k < ref2:k > ref2; i = ref1 <= ref2? ++k: --k) {        Columns[i] = height + ($element. Data (' height ') | | $element. outerheight ()) + This.settings.gutter;      }      return {        X:column * (This.settings.base + this.settings.gutter),        y:height      };    };
   

  

The question of how many columns are displayed for the JQuery gridly control.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.