Gridstack.js: μ‚¬μš©μž μ •μ˜ λ“œλž˜κ·Έ ν•Έλ“€

에 λ§Œλ“  2015λ…„ 03μ›” 24일  Β·  3μ½”λ©˜νŠΈ  Β·  좜처: gridstack/gridstack.js

μ‚¬μš©μž μ •μ˜ λ“œλž˜κ·Έ ν•Έλ“€ μ‚¬μš©μ— λŒ€ν•œ μ˜ˆκ°€ μžˆμŠ΅λ‹ˆκΉŒ?
νŒ¨λ„ 헀더(전체가 μ•„λ‹˜)λ₯Ό μ‚¬μš©ν•˜μ—¬ ν•­λͺ©μ„ λ“œλž˜κ·Έ κ°€λŠ₯ν•˜κ²Œ λ§Œλ“€λ €κ³  ν•©λ‹ˆλ‹€. κ°€λŠ₯ν•œ λ§Žμ€ μ‘°ν•©μœΌλ‘œ μ•„λž˜ μ½”λ“œλ₯Ό μ‹œλ„ν–ˆμ§€λ§Œ μ„±κ³΅ν•˜μ§€ λͺ»ν–ˆμŠ΅λ‹ˆλ‹€.

    <div class="grid-stack">
        <div class="grid-stack-item"
                 data-gs-x="0" data-gs-y="0"
                 data-gs-width="4" data-gs-height="2">
            <div class="grid-stack-item-content panel panel-default">
                <div class="panel-heading clearfix">
                    <span class="panel-title pull-left"><span class="glyphicon glyphicon-asterisk"></span> <span class="panel-title-text">Featuring</span></span>
                </div>
                <div class="panel-body ">
                    <ul class="list-group">
                        <li class="list-group-item">a</li>
                        <li class="list-group-item">v</li>
                    </ul>
                </div>
            </div>
        </div>
    </div

js μ½”λ“œ:

    var options = {
        cell_height: 80,
        vertical_margin: 10,
        animate: true,
        handle:  ??? 
    };
    this.$('.grid-stack').gridstack(options);

handle:'.panel' , handle:'panel-heading' 및 ν•Έλ“€ 없이 μ‹œλ„ν–ˆμŠ΅λ‹ˆλ‹€. 그리고 grid-stack-item-content ν΄λž˜μŠ€λ„ μ œκ±°ν•˜λ €κ³  μ‹œλ„ν–ˆμ§€λ§Œ λͺ¨λ“  κ²½μš°μ— κ²°κ³ΌλŠ” either the whole thing moves or nothing moves at all .

ν•­λͺ©μ„ ν—€λ”λ‘œλ§Œ 이동 κ°€λŠ₯ν•˜κ²Œ λ§Œλ“œλŠ” 방법은 λ¬΄μ—‡μž…λ‹ˆκΉŒ?

κ°€μž₯ μœ μš©ν•œ λŒ“κΈ€

μ•Ό ν¬λ¦¬μŠˆλ‚˜

λ¬Έμ œλŠ” μ˜΅μ…˜ λ³€μˆ˜μ— μžˆλŠ” 것 κ°™μŠ΅λ‹ˆλ‹€.

라이브러리 μ½”λ“œλ₯Ό μ‚΄νŽ΄λ³΄λ©΄ 379ν–‰λΆ€ν„° κΈ°λ³Έ μ˜΅μ…˜κ³Ό ꡬ성 방식을 λ³Ό 수 μžˆμŠ΅λ‹ˆλ‹€.

μ‚¬μš©μž μ •μ˜ λ“œλž˜κ·Έ κ°€λŠ₯ μ»¨ν…Œμ΄λ„ˆμ˜ 핸듀은 λ“œλž˜κ·Έ κ°€λŠ₯ μ†μ„±μ˜ ν•˜μœ„ 속성이어야 ν•©λ‹ˆλ‹€. js μ½”λ“œλŠ” λ‹€μŒκ³Ό κ°™μ•„μ•Ό ν•©λ‹ˆλ‹€.

var options = {
    cell_height: 80,
    vertical_margin: 10,
    animate: true,
    draggable: {
        handle: '.panel-heading',
    }
};
this.$('.grid-stack').gridstack(options);

λͺ¨λ“  3 λŒ“κΈ€

μ•Ό ν¬λ¦¬μŠˆλ‚˜

λ¬Έμ œλŠ” μ˜΅μ…˜ λ³€μˆ˜μ— μžˆλŠ” 것 κ°™μŠ΅λ‹ˆλ‹€.

라이브러리 μ½”λ“œλ₯Ό μ‚΄νŽ΄λ³΄λ©΄ 379ν–‰λΆ€ν„° κΈ°λ³Έ μ˜΅μ…˜κ³Ό ꡬ성 방식을 λ³Ό 수 μžˆμŠ΅λ‹ˆλ‹€.

μ‚¬μš©μž μ •μ˜ λ“œλž˜κ·Έ κ°€λŠ₯ μ»¨ν…Œμ΄λ„ˆμ˜ 핸듀은 λ“œλž˜κ·Έ κ°€λŠ₯ μ†μ„±μ˜ ν•˜μœ„ 속성이어야 ν•©λ‹ˆλ‹€. js μ½”λ“œλŠ” λ‹€μŒκ³Ό κ°™μ•„μ•Ό ν•©λ‹ˆλ‹€.

var options = {
    cell_height: 80,
    vertical_margin: 10,
    animate: true,
    draggable: {
        handle: '.panel-heading',
    }
};
this.$('.grid-stack').gridstack(options);

λ©‹μ Έμš”. 정말 맀λ ₯μ μ΄κ΅°μš”. 당신은 ν›Œλ₯­ν•©λ‹ˆλ‹€. ν•˜λ£¨ 쒅일 그것을 κ±·μ–΄μ°¨κ³  μ—¬κΈ° λ‹Ήμ‹ μ˜ λŒ€λ‹΅μ΄ μžˆμŠ΅λ‹ˆλ‹€. 그리고 그것은 단지 μž‘λ™ν•©λ‹ˆλ‹€ :) λ†€λžμŠ΅λ‹ˆλ‹€.

정말 도움이 λ˜μ—ˆμŠ΅λ‹ˆλ‹€. κ°μ‚¬ν•©λ‹ˆλ‹€.

이 νŽ˜μ΄μ§€κ°€ 도움이 λ˜μ—ˆλ‚˜μš”?
0 / 5 - 0 λ“±κΈ‰