HTML52012. 4. 4. 01:13

Sencha Touch에선 기본 컴포넌트로 그리드를 제공하지 않는다.

 

단순히 데이터뷰와 리스트정도만 제공하고 있는데 데이터를 여러개 표시할 땐 이 데이터가 무엇을 나타내는지

 

헤더로 표현해주지 않으면 애매할 경우가 있다.

 

혹시나 그리드를 구현하는 예제가 있나 구글링을 하다가 찾아냈다.

 

일단 그냥 쓰기에는 괜찮으나 editable type같은 경우엔 약간의 문제가 있다.

 

예제 소스 안에 feature폴더에 보면 Editable.js이 있는데 여기에 약간 수정을 해주면

 

정상적으로 동작한다. 소스는 아래를 참조하길 바란다.

 

handleTap : function(grid, index, rowEl, rec, e) {
var editor = this.getActiveEditor();

if (editor) {

if (!e.getTarget('input') && !e.getTarget('div.x-clear-icon')) {

var field = editor.field,
component = field.getComponent(),
value = component.getValue();

if(value == ""){
console.log(editor.record.get(field.getName()));
value = editor.record.get(field.getName());
}
field.destroy();

if (field.isDirty()) {
editor.record.set(field.getName(), value);
} else {
field.getRenderTo().setHtml(editor.htmlValue);
}

this.setActiveEditor(null);
}

 

 

 

https://github.com/mitchellsimoens/Ext.ux.touch.grid/

Posted by 미랭군
HTML52012. 4. 4. 00:14

웹에서 Sencha Touch를 개발해볼 수 있는 환경을 제공해주네요.

유용한 것 같습니다.

 

 

http://www.senchafiddle.com/

Posted by 미랭군
게임개발2012. 3. 29. 09:43

function MouseClickHandler(e)
{
    tpx = e.pageX; //마우스 클릭 x좌표
    tpy = e.pageY; //마우스 클릭 y좌표
 
    tx = tpx - 객체.x;
    ty = tpy - 객체.y;

    an = Math.atan2(ty, tx) * 180 / Math.PI; //객체와 마우스 클릭 좌표 사이의 각도
    di = Math.sqrt(tx * tx + ty * ty); //객체와 마우스 클릭 좌표 사이의 거리

    if( di > 5 ) { // 거리가 5보다 차이가 나면
         객체._x = 객체._x + Math.cos(an * (Math.PI / 180)) * 10 //등속운동
         객체._y = 객체._y + Math.sin(an * (Math.PI / 180)) * 10
    }
}

'게임개발' 카테고리의 다른 글

게임 개발 시 필요한 라이브러리  (0) 2012.09.14
Posted by 미랭군