2008년 4월 30일 수요일

익현이의 촌철살인....

익현이 엄마와 이모 그리고 장모님이 대화 중 이었다.
상대적으로 익현이의 엄마는 조용히 얘기 하고 이모와 장모님은 큰 목소리로 얘기 하고 있었나보다.

익현이가 엄마를 잡아 끌면서

"엄마 그냥 냅둬..쟤네들 싸우게 그냥 냅둬~~"

ㅎㅎㅎ

2008년 4월 29일 화요일

특정 tab Access 할 경우

function handleActivate(tab){
        alert(tab.title + ' was activated.');
    }

lisntener에서 실행되는 function

event tab



 var tabs2 = new Ext.TabPanel({
        renderTo: document.body,
        activeTab: 0,
        width:600,
        height:250,
        plain:true,
        defaults:{autoScroll: true},
        items:[{
                title: 'Normal Tab',
                html: "My content was added during construction."
            },{
                title: 'Ajax Tab 1',
                autoLoad:'ajax1.htm'
            },{
                title: 'Ajax Tab 2',
                autoLoad: {url: 'ajax2.htm', params: 'foo=bar&wtf=1'}
            },{
                title: 'Event Tab',
                listeners: {activate: handleActivate},
                html: "I am tab 4's content. I also have an event listener attached."
            },{
                title: 'Disabled Tab',
                disabled:true,
                html: "Can't see me cause I'm disabled"
            }
        ]
    });
event catch의 다른 방법이 보임

무료 골프신청 사이트

매주 화요일
https://www.namyeoju.co.kr
http://www.nanji-golf.or.kr

2008년 4월 24일 목요일

어제 SKT 강남역 불통사건

사무실이 강남역 근처다. 어제 집사람이 카자흐스탄 출장에서 돌아온 날이라 일찍 퇴근을 하여 설레는 마음으로 집으로 가는 길 이었다.

'나 출발 했다고 연락 해야지' 라고 마음먹고 집사람의 폰으로 전화를 했다.
집사람은 SKT의 열열 추종자이며 (한 10년 쓴것 같으다), 최근에 보아폰으로 변경을 했다.

이상했다. 아무런 멘트고 뭐고 당최 연락이 되지 않고 있었다.
문자를 보냈다, 답장이 없었다.

집에 와보니 집사람이 자고 있었다. 밥을 다 먹고 얘기를 한참 하는 중 문자가 왔다. 내가 보낸 문자였다. ==; 집사람이 왜 집에서 어디냐구 문자를 보냈냐구 웃으며 "나 여깄쟎아~~" 이러면서 한 번 웃었다.

알고보니 불통 사건 때문에 벌어진 일이었다.
만약 집사람이 집에서 안 자고 서로 어딘가에서 만나서 외식이라도 하기로 했으면 참 답답할 뻔 했다.

SKT에서 바꾸라고 아무리 그래도 당최 바꾸질 않는다. SK가 뭘 해줬다고 그러는지..ㅎㅎ

봉쇼~

아침마다 버스를 타고 출근을 한다. 헌데 버스에는 항상 봉쇼? 를 하는 여자들이 있다.
왜 여러사람이 잡으라는 봉을 혼자 휘감고 있는지 모르겠다.
여자들이 원래 기둥을 좋아하는걸까?
흔들리는 버스에서 안정을 잡기위해 봉을 휘감으면 혼자는 좋을지 몰라도 그걸 볼때 마다 기분이 좋지 않다. 나도 잡고 싶은데~봉~

2008년 4월 21일 월요일

혜승이와 하고 싶은일

말할 수 없는 비밀이란 영화 소개를 보곤 예전에 쳤었던 피아노를 치고 싶은 마음이 다시 생겼다.

체르니 30번가지 쳤지만 지금은 악보도 볼 줄 모르게 되고 말았다.

그때 어머니께서 그렇게 열심히 가르치려 노력 했건만 왜 그때는 그게 나중에 커서 좋을거란건 몰랐었을까?

다시 한 번 배우고 싶다. 나에게 좌절을 안겼던 피..아..노

주말 (4월26일) 혜승이와 다닐 수 있는 피아노 학원을 알아봐야겠다. ^^; 주말반으로..

성공적인 육아를 위한 부모 20계명

깔끔한 외모에 신경을 쓴다.
헐렁한 트레이닝 바지에 헝클어진 머리를 한 엄마, 집 안 어디서나 담배를 마구 피우는 아빠를 보며 아이들은 배울 것이 없다. 자기 관리가 철저한 부모 밑에서 자란 아이가 깔끔하게 일 처리하는 사람으로 자라는 것은 당연하다.

2. 긍정적으로 말한다.
아이들은 부모의 언어 습관을 보고 그대로 따른다. 특히 이제 막 말을 배우는 세 살, 네 살 정도의 아이들은 더하다. 그러므로 부모가 "~ 하면 안된다""~하면 맞는다" 등의 부정적인 언어를 사용하면 아이들도 따라하게 된다. 부정적인 말을 사용하는 사람은 생각도 부정적으로 바뀐다.

3. 긍정적인 호칭을 쓴다.
아이들을 '돌머리'라고 말하면 돌머리로 자라고,'예쁜이'라고 말하면 예쁜이로 자란다. 왜냐하면 부모가 부르는 호칭은 아이들의 잠재 의식 속에 그대로 심어지기 때문이다. 지금 당장 아이를 부를 때 긍정적인 호칭을 부르도록 한다.

4. 꿈을 주는 인테리어
집 안 환경도 아이들의 꿈에 많은 영향을 끼친다. 넓고 푸른 자연이 있는 그림, 아이가 존경할 만한 위인의 사진이 하나쯤은 집안에 붙어 있어야 한다.

5. 아이들의 스트레스는 바로 풀어준다.
아이들도 스트레스가 많다. 이럴 때 부모가 아이의 눈 높이로 맞춰서 농담도 하고, 함께 운동도 하면서 스트레스를 풀어주도록 한다.

6. 함께 놀아준다.
컴퓨터 게임, 블록놀이, 총싸움 등 아이들의 놀이에 참가해보면 의외로 재미있는 것을 알게 될 것이다. 자기와 함께 놀아주는 부모를 보며 아이들은 어른과 부모에 대한 깊은 신뢰감을 갖게 된다. 어렵지 않은 것이므로 지금 당장 실천해도 좋다.

7. 좋아하는 음식을 해준다.
아이들의 오감을 끊임없이 계발해주는 것이 좋다. 그런데 맨 날 똑같은 음식만 먹다 보면 오감은 계발 될 기회를 잃게 된다. 아이의 미각을 계발하기 위해 다양한 요리 만들기에 도전해본다.

8. 작은 일도 축하해준다.
게임 최고점을 낸 일, 전날에 비해 가위로 색종이를 자르는 일을 잘할 때 주저하지 않고 축하해준다. 부모의 진심 어린 축하에 아이들은 성취감을 느끼게 될 것이다.

9. 단점보다 장점에 집중한다.
누구나 완벽한 사람은 없다. 장점도 있고, 단점도 있다. 하지만 부모가 아이의 단점을 혼내기보다 장점에 관심을 보인다면 아이는 부모가 관심을 보이는 것에 더 노력을 기울이게 된다.

10. 친구들에 대해 훤히 안다.
지금 당장 우리 아이가 친하게 지내는 아이들의 이름을 몇 개나 말할 수 있나? 친하게 지내는 친구들의 행동을 우리 아이가 현재 어떤 상태인지 상상이 가능해진다. 그러므로 친구들에 대해 많은 관심을 갖는다.

11. 아이의 우상을 존중해준다.
20세기를 산 부모의 우상과 21세기를 살 자녀의 우상이 같을 수 없다. 그러므로 부모의 잣대로 아이의 우상을 비웃지 말고 존중해준다.

12. 성적이 오르지 않는 원인을 파악한다.
성적이 오르지 않을 때 그 원인을 아이 스스로는 알 수 없지만 부모는 아이의 어떤 태도와 행동이 문제인지 금방 알 수 있다. 그것을 아이 스스로 느껴 태도를 바꿀 수 있도록 부모가 옆에서 자연스럽게 유도한다.

13. 긍정적인 기대감을 갖는다.
아이는 부모가 기대한 대로 자란다. 그러므로 아이에 대한 기대감을 아이에게 부담으로 다가가지 않는 범위 내에서 드러내도록 한다.

14. 아이의 능력을 믿는다.
아이를 믿는다는 것은 아주 중요하다. 아이는 부모가 자기를 믿는다는 것을 알면 자신감이 생겨 모든 일에 적극적으로 대처하게 된다.

15. 기쁜 아침을 만들어 준다.
아침의 기분은 하루를 좌우한다. 그러므로 아무리 화가 나는 일이 있어도 아침에는 기분 좋은 얼굴로 자녀를 대하도록 한다.

16. 스스로 모범을 보인다.
책읽기를 즐기는 부모 밑에서 책을 좋아하는 아이가 자라고, 약속을 잘 지키는 부모의 모습을 보고자란 아이가 약속의 중요함을 안다.

17. 식사 때는 기분 좋은 얘기만 한다.
식사 때는 기분 좋은 얘기를 하면 소화액이 잘 분비된다. 그러므로 식사시간에 아이에게 꾸중을 하거나 장황한 설교를 늘어놓지 않는다.

18. 육아에 대해 항상 연구한다.
아마도 이 항목에 있어서 우리 나라 부모님들은 최고 점수를 받을 것이다. 육아와 지능계발에 대해서는 관심이 대단하기 때문이다. 하지만 관심만 갖고 있으면 되는 게 아니라 끊임없이 책과 최신 뉴스를 보며 연구하고 공부해야 좋은 부모이다.

19. 아이에게 글을 쓴다.
말을 하다 보면 자꾸만 이야기가 장황해지고 비논리적으로 될 때가 있다. 이럴 때는 아이에 대한 기대를 글로 적어서 건네준다.

20. 함께 계획을 세운다.
아이들은 모든 일에 참견(?)하기를 좋아하는데 특히 부모와 함께 일을 하는 것을 좋아한다. 그러므로 자녀에 관한 문제뿐만 아니라 집안 일에도 아이의 의견을 묻고 함께 계획을 세우거나 해결을 하는 것이 좋다.

핌즈 웍샵 다녀왔음...

사용자 삽입 이미지
김밥을 싸서 갔습니다. 김밥이 이상한 모양입니다.

사용자 삽입 이미지

정상적인 김밥은 이런 모양...미진,은영양 수고 많았소

사용자 삽입 이미지
휘팍 정상엔 아직 눈이~~

사용자 삽입 이미지

우리가 묵을 숙소 유럽풍임..--

사용자 삽입 이미지

앗~
사용자 삽입 이미지
이건 폰카라 어쩔 수 없음 나오는게 어디여..

사용자 삽입 이미지
김밥이 아직 남았군....

사용자 삽입 이미지
왕머리..

사용자 삽입 이미지
병아리 ...

사용자 삽입 이미지
유럽풍 분수..

사용자 삽입 이미지

분수 쇼~

사용자 삽입 이미지

유럽풍 전경...이궁..어디 유럽에 가본적도 없으면서..팬션 설명에 그렇게 써 놨길래..

사용자 삽입 이미지
황대리..

사용자 삽입 이미지
오~꺼꾸리와 장다리?

사용자 삽입 이미지
바베큐~~~

사용자 삽입 이미지
낮부터 밤까지 바베큐~~~
ㅎㅎㅎㅎ



2008년 4월 18일 금요일

WWW::Mechanize 를 사용한 input 처리

실제 html 폼
<html>
<head><title>test</title>
<body>
<form>
   <input type=hidden name="hidden1" value="v_h1">
   <input type=text name="txt1" value="v_txt1">
   <input type=text name="txt2" value="v_txt2">
   <input type=hidden name="hidden2" value="v_txt2">
   <input type=checkbox name="chk1" value="v_chk1" >
   <input type=checkbox name="chk1" value="v_chk2" checked>
   <input type=radio name="rdo1" value="v_rdo1" >
   <input type=radio name="rdo1" value="v_rdo2" checked>
   <textarea name='txt_desc'>haha</textarea>
</form>
</body>
</html>
스크리핑 실행하는 perl 모듈
use WWW::Mechanize;
use Data::Dumper;

#############################
# begin of test part
# form 값을 parsing
my $agent = WWW::Mechanize->new( ); 
$agent->get( "http://scm.ezadmin.co.kr/test_form.html" );

my @forms = $agent->forms();
my $form = $forms[0];

print Dumper $form;

print "\n ============================ \n";

# Check all the boxes
foreach my $input ( @{$form->{inputs}} ) {
    print $input->{name} , "/" ;

    # hidden, text 처리
    if ( $input->{type} eq "text" or $input->{type} eq "hidden" or $input->{type} eq "textarea" )
    {
        print $input->{value}, "\n";
    }
    elsif ( $input->{type} eq "checkbox" or $input->{type} eq "radio" )
    {
        my $current = $input->{current};
        print $input->{menu}[$current]->{value} . "\n";
    }
}




무료 핸드폰 전화

사용자 삽입 이미지




























http://www.sponsorcall.net/demo/onse/index.do?keyNo=686495f6dd573be4

무료 핸드폰 통화가 가능하다.

거는 사람 받는 사람 번호를 입력하면 먼저 거는 사람에게 전화가 걸려 오고 다음에 받는 사람으로 전화가 가게 된다.

몇몇 사람에게 전화 통화를 해 봤는데, 해외 로밍도 되는지 모르겠다. 마침 집사람이 카자흐스탄에 출장을 가서 그쪽으로 전화 해봤는데 통화는 실패 하고 말았다. ㅎㅎ

어차피 집사람은 인터넷폰 가져가서 무료로 통화를 할 수 있지만 이것도 재미있어서 해봤다.

2008년 4월 16일 수요일

몰입의 기술

난 동기유발이란데 관심이 많다. 어딘가에서 사람을 움직이는 유일한 힘이 동기라고 한 글을 읽은 적이 있다.

그렇다면 동기는 어떻게 유발될까? 많은 사람들은 돈이나 권력, 명예, 괘락 등이 세상을 지배한다고 생각하지만 이유없이 그런목표들을 희생시키는 사람들도 있다. 물질적인 보상을 포기하고 일상생활을 보다 의미있게 만드는 무엇인가를 찾고자 한다. 그들의 동기는 무엇일까? 왜 그들은 동기가 생겼을까?

미하이 칙센트미하이의 "몰입의 기술"에서는 유달리 암벽등반이라는 내용이 나오는데 그 이유는 암벽등반이라는 스포츠가 유달리 몰입도가 높기 때문이라고 한다.

여하튼 그가 중요시 하고 알고자 한건 내적 동기화라는 것이다. 내적 동기화가 무엇인가? 간단히 만족이라는 단어로 표현을 해보면 어떨까? 한다. 인간이 객관적인 보상에 의해 움직인다라는 사실은 이제 보편적인 진실처럼 생각이 되지만 이것은 '강화'라는 단계에 의해 사회적으로 교육된 것일 수 있다. 소위 "소유"에 대한 욕심은 인류 보편적인 특성이 아니다. 물질적 목표를 중시하지 않는 문화들이 존재한다는것이 그 증거이다.

 어찌보면 외적 보상은 지배자들이 피지배자를 손쉽게 움직이게 하기 위한 트릭 혹은 속임수 일지 모른다. 우리 모두는 즐겁게 하는것에 익숙하지 못하다. 사장은 종업원들이 일을 즐겁게 하는것에는 관심이 없고 내가 봉급을 주기때문에 일을 하는구나, 선생들 마져 학생들이 얼마나 즐겁게 공부를 하는가는 관심이 없고 나중에 출세를 하기 위해 공부를 해야 한다, 돈을 벌기 위해 공부를 해야 한다 와 같은 생각들이 사회를 지배 하고 있다. 우리는 일과 여가를 구분하는 방법을 배워왔다. 일은 혹은 공부는 대부분의 시간을 보내면서 해야하는 일이고 여가는 쓸데 없지만 좋아서 하는 일이다. 그러므로 직장에서는 권태와 좌절을 느끼고 여가시간에는 죄의식을 느끼게 되는 것이다, 그 결과 산업국가의 노동자들은 깊은 소외감을 느끼게 된다, 나는 여기서 어떻게 하면 조직의 구성원들을 즐거운 마음으로 일 할 수 있다록 만들것인가? 그리고 나 스스로도 어떻게 하면 즐겁게 일을 할 것인가?를 생각해 보지 않을 수 없다. 내가 좋아하는 것은 무엇인가? 호모 쿵푸스에서 사람이 유일하게 만족을 얻을 수 있는 일이란 무엇인가를 배워 뇌를 지적으로 충만한 상태로 만들때 뿐이라고 했다. 고로 배움이야 말로 가장 즐거운 일이라고 했다. 허나 지금까지의 우리들은 학교에서 하는것이 공부요 공부는 하기 싫지만 억지로 해야 하는 것 이라는 구조에서 평생을 살아왔다 즉 지속적 강화작업이 진행된 상태인 것이다. 이제 외적인 만족이 부족할때 우리는 어떻게 동기 유발을 해야 하고 몰입을 할 수 있을까? 하는 궁금증이 생겨난다.

 사실 지금과 같은 외적 보상이 유일한 보상체계인 사회는 필연적으로 망할 수 밖에 없는 구조이다. 왜냐면 몇가지 룰이 존재 하기 때문이다. 기본적으로 승자 독식, 제로섬, 유한한 자원 이를 종합적으로 얘기 해 보면 유한한 자원을 승자들이 독식함으로써 만족을 느끼고 그들이 거둬들인 재화는 보편적 다수로 부터 박탈한 것일 수 있기 때문이다. 당연히 모든것을 갖은 소수와 우울한 다수가 사회를 구성하게 되는것이다. 물론 이 격차는 점차 벌어질 수 있다. 지위 상승은 힘들지만 하락은 쉽기 때문이다, 흠 다소 주관적인 의견일 수 있을지 모르나 분명 어딘가에서 읽은 기억이 있다.

 "자존감" 이라는 말이 있다. 책 제목이 기억나자 않는데 자기 존재감 이라고도 풀어 얘기 할 수 있는 것이다. 이 자존감은 개인이 어떤 어려운 문제를 해결할 경우 얻게 되는 기쁨이나 만족을 느낌으로 얻어질 수 있다고 했다. 그것들이 쌓임으로써 개인은 어려운 일도 포기하지 않고 해결해 낼 수 있게 되는 것이다.

 어떻게 하면 내적 동기를 얻을 수 있을까? 왜 나의 마음속에는 내적 동기가 일어나지 않을까? 무엇인가를 배움으로써 얻는 즐거움보다 배우기 귀챦은 마음이 더 많을 경우엔 어떻게 극복해야 할까? 심지어는 외적 보상조차 나의 동기를 유발 시킬 것 같지 않다. 허나 일은 몰입해서 하고 있으며 배움은 끝이 없도다. 해야할 일은 산더미 같으며 앞으로는 점점 잘 될 것이다라는 강한 마음이 있다.

오늘은 이까지...

2008년 4월 14일 월요일

페이지 레이아웃

item의 region이 관건이었음
...흠 그것도 모르고 region을 임의로 지정해서 사용했더니 완전 걸래 됐었음

north
west  center east
south

를 사용해야 함...

// begin of onReady
Ext.onReady(function(){
    new Ext.Viewport({
        layout: 'border',
        defaults: {
            activeItem: 0
        },
        items: [{
            region: 'north',
            title: 'search',
            //html: '<h1 class="x-panel-header">Page Title</h1>',
            contentEl: 'div_header',
            split: true,
            autoHeight: true,
            border: false,
            margins: '0 0 0 0',
            height: 100,
            minHeight: 100
        },  {
            region: 'west',
            collapsible: true,
            title: 'Navigation',
            xtype: 'treepanel',
                width: 200,
            autoScroll: true,
            split: true,
            loader: new Ext.tree.TreeLoader(),
            root: new Ext.tree.AsyncTreeNode({
                expanded: true,
                children: [{
                    text: 'Menu Option 1',
                    leaf: true
                }, {
                    text: 'Menu Option 2',
                    leaf: true
                }, {
                    text: 'Menu Option 3',
                    leaf: true
                }]
            }),
            rootVisible: false,
            listeners: {
                click: function(n) {
                    Ext.Msg.alert('Navigation Tree Click', 'You clicked: "' +  attributes.text + '"');
                }
            }
        },        
        {
            region: 'center',
            xtype: 'tabpanel',
            items: {
                title: 'Default Tab',
                html: 'The first tab\'s content. Others may be added dynamically'
            }
        }, {
            region: 'south',
            title: 'Information',
            collapsible: false,
            html: 'Information goes here',
            split: true,
            height: 300,
            minHeight: 300
        }]
    });
})

2008년 4월 11일 금요일

ext panel 샘플

// This code will generate a layout table that is 3 columns by 2 rows
// with some spanning included.  The basic layout will be:
// +--------+-----------------+
// |   A    |   B             |
// |        |--------+--------|
// |        |   C    |   D    |
// +--------+--------+--------+
var table = new Ext.Panel({
    title: 'Table Layout',
    layout:'table',
    defaults: {
        // applied to each contained panel
        bodyStyle:'padding:20px'
    },
    layoutConfig: {
        // The total column count must be specified here
        columns: 3
    },
    items: [{
        html: '<p>Cell A content</p>',
        rowspan: 2
    },{
        html: '<p>Cell B content</p>',
        colspan: 2
    },{
        html: '<p>Cell C content</p>'
    },{
        html: '<p>Cell D content</p>'
    }]
});

2008년 4월 9일 수요일

알부라리 방송 루이..ㅋㅋㅋ

아랍에서 수영복 모델하다 추방됐다는 루이 ㅋㅋㅋ 원래 이름은 최윤경이라고 하네..

전세계 120개국에서 동시 방송을 하기 위해 전파를 무리 하게 쏘다보니 돈이 없어서 스튜디오가 허접하다는 알 부라리 방송 ㅋㅋ

오늘 스케줄이 있어서 방송을 빨리 하는 중 "어디가는데?" 라는 질문을 받은 루이의 답변 "알라신이 부르십니다." ㅋㅋ

방송보기



more..

mnet 알부라리 방송

오늘 케이블 채널을 돌리다 우연히 보게 되었다.

어찌나 웃긴지 바로 팬이 되고 말았다.

지나간 연예계 소식을 아랍의 입장에서 마치 새로운 소식인듯 뉴스 혹은 퀴즈의 형식으로 진행해 나가는 식이었는데, 듀크의 김지훈이 바자히 알 자히라 압둘바바 돈디아로 압살라쿰이라고  진행을 맡았고 루이라는 미모의 리포터가 서포트를 해 주는 식이었는데, 정말 게스트도 그렇고 무엇보다 스튜디오의 허접함이 마음에 들었다 ㅋㅋㅋ

2008년 4월 8일 화요일

Linux에서 한글 excel 읽어 들이기

Linux에서 한글 excel을 읽으면 한글이 전부 깨진다...흠흠..

아래와 같은 방법으로 엑셀을 읽어 들이면 된다. 테스트 해보니 original과 변경된 값을 모두 볼 수 있음

훌륭함~~~

use Spreadsheet::ParseExcel;
use Spreadsheet::ParseExcel::FmtUnicode;               
my $oExcel = new Spreadsheet::ParseExcel;

my $oFmt = Spreadsheet::ParseExcel::FmtUnicode->new(Unicode_Map => "euc-kr");
my $oBook = $oExcel->Parse("kshsame.xls", $oFmt);

    my($iR, $iC, $oWkS, $oWkC);
    print "FILE  :", $oBook->{File} , "\n";
    print "COUNT :", $oBook->{SheetCount} , "\n";
    print "AUTHOR:", $oBook->{Author} , "\n";
    for(my $iSheet=0; $iSheet < $oBook->{SheetCount} ; $iSheet++) {
        $oWkS = $oBook->{Worksheet}[$iSheet];
        print "--------- SHEET:", $oWkS->{Name}, "\n";
        for(my $iR = $oWkS->{MinRow} ;
                defined $oWkS->{MaxRow} && $iR <= $oWkS->{MaxRow} ; $iR++) {
            for(my $iC = $oWkS->{MinCol} ;
                            defined $oWkS->{MaxCol} && $iC <= $oWkS->{MaxCol} ; $iC++) {
                $oWkC = $oWkS->{Cells}[$iR][$iC];
                print "( $iR , $iC ) =>", $oWkC->Value, "\n" if($oWkC);  # Formatted Value
                print "( $iR , $iC ) =>", $oWkC->{Val}, "\n" if($oWkC);  # Original Value
            }
        }
    }


무한걸스 촬영하는것을 우연히 보게 됨

지난 일요일 가족들과 용산 가족 공원을 놀러 갔다가 무한 걸스 촬영 현장을 봤다.
사용자 삽입 이미지

케이블인데 의외로 카메라도 많고 크레인도 동원 됐었다.
즐겨 보진 못하지만 좋아하는 프로그램인데..^^;

그날은 특별히 황보가 출연했었다.

2008년 4월 7일 월요일

다이나믹 탭 추가


function add_grid( rowIndex )
    {
        // grid object 추가    
        objtext = new Ext.form.TextField({
            name: "txt_trans_no",
            id: "txt_trans_no",
            fieldLabel: '회수 송장번호',
            width: 200,
            allowBlank: false,
            autoShow: true
        });

        // form 생성
        var form = new Ext.form.FormPanel({
            baseCls: 'x-plain',
            labelWidth: 120,
            items: [objtext],
            autoShow: true
        });

        tabs.add({
            title: 'New Tab ' + (++rowIndex),
            items: [form],
            closable:true
        }).show();

        // doLayout을 해야 tabs의 내용이 반영된다.
      // 이걸 안 해서 하루종일 삽질 함..
        tabs.doLayout();
    }

json으로 extjs.store에 load된 data의 엑세스

json 포맷

$val["total_rows"] = 4;
$val["total_price"] = 400;
$val["list"][] = array(
                   trans_date_pos=>"2008-4-4",
                   domain=>"test",
                   warehouse=>"K",
                   qty=>13);
$val["list"][] = array(
                   trans_date_pos=>"2008-4-4",
                   domain=>"test",
                   warehouse=>"K",
                   qty=>13);


Extjs.store

store = new Ext.data.GroupingStore({
        proxy: new Ext.data.HttpProxy(
                   new Ext.data.Connection({
                        url: '_URL_',
                        method: 'POST'
                })),
        reader: new Ext.data.JsonReader({
            totalProperty: 'total_rows',
            root: "list",
            fields: ["trans_date_pos","domain","warehouse","qty"]
        })
    });

Data Access

            return되는 경우 다음과 같이 처리 되어야 함

store.reader.jsonData['total_price']




 

event 처리

Extjs는 eventmanager라는 class가 있음
http://extjs.com/deploy/ext/docs/output/Ext.EventManager.html#addListener

예를들어 extjs.store가 load가 발생할 경우 load라는 이벤트가 발생한다.
api 메뉴얼에서 참조 하면 됨.

발생된 event를 catch해서 작업을 수행하고자 할 경우

샘플
el.on({
    'click' : {
        fn: this.onClick
        scope: this,
        delay: 100
    },
    'mouseover' : {
        fn: this.onMouseOver
        scope: this
    },
    'mouseout' : {
        fn: this.onMouseOut
        scope: this
    }
});


    ///////////////////////////////////////
    // 실 소스에서 event 추가
    // store는 Extjs.store를 사용
    store.on ({  
        'load':{
            fn: function(){
                alert('aborted')
            }
        }
    }); 

EXT CLASS에 대한 설명 매우 중요

참조: http://extjs.com/deploy/ext/docs/output/Ext.html

Class Ext

Package: Global
Class: Ext
Extends: Object
Defined In: Ext.js
Ext core utilities and functions.

This class is a singleton and cannot be created directly.

Properties   -  Methods   -  Events

Public Properties

Property Defined By
  BLANK_IMAGE_URL : String Ext
URL to a 1x1 transparent gif image used by Ext to create inline icons with CSS background images. (Defaults to "http:...
  SSL_SECURE_URL : String Ext
URL to a blank file used by Ext when in secure mode for iframe src and onReady src to prevent the IE insecure content...
  enableGarbageCollector : Boolean Ext
True to automatically uncache orphaned Ext.Elements periodically (defaults to true)
  enableListenerCollection : Boolean Ext
True to automatically purge event listeners after uncaching an element (defaults to false). Note: this only happens i...
  isBorderBox : Boolean Ext
  isGecko : Boolean Ext
  isIE : Boolean Ext
  isIE7 : Boolean Ext
  isLinux : Boolean Ext
  isMac : Boolean Ext
  isOpera : Boolean Ext
  isReady : Boolean Ext
True when the document is fully initialized and ready for action
  isSafari : Boolean Ext
  isSecure : Boolean Ext
True if the page is running over SSL
  isStrict : Boolean Ext
True if the browser is in strict mode
  isWindows : Boolean Ext
  useShims : Boolean Ext
By default, Ext intelligently decides whether floating elements should be shimmed. If you are using flash, you ...

Public Methods

Method Defined By
  addBehaviors( Object obj ) : void Ext
Applies event listeners to elements by selectors when the document is ready. The event name is specified with an @ su...
  apply( Object obj, Object config, Object defaults ) : Object Ext
Copies all the properties of config to obj.
  applyIf( Object obj, Object config ) : Object Ext
Copies all the properties of config to obj if they don't already exist.
  decode() : void Ext
Shorthand for Ext.util.JSON.decode
  each( Array/NodeList/Mixed array, Function fn, Object scope ) : void Ext
Iterates an array calling the passed function with each item, stopping if your function returns false. If the passed ...
  encode() : void Ext
Shorthand for Ext.util.JSON.encode
  escapeRe( String str ) : String Ext
Escapes the passed string for use in a regular expression
  extend( Object subclass, Object superclass, [Object overrides] ) : void Ext
Extends one class with another class and optionally overrides members with the passed literal. This class also adds t...
  fly( String/HTMLElement el, [String named] ) : Element Ext
<static> Gets the globally shared flyweight Element, with the passed node as the active element. Do not store a...
  get( String/HTMLElement/Element el ) : Element Ext
Static method to retrieve Element objects. Uses simple caching to consistently return the same object. Automatically ...
  getCmp( String id ) : Ext.Component Ext
Shorthand for Ext.ComponentMgr.get
  getDom( String/HTMLElement/Ext.Element el ) : HTMLElement Ext
Return the dom node for the passed string (id), dom node, or Ext.Element
  id( [String/HTMLElement/Element el], [String prefix] ) : String Ext
Generates unique ids. If the element already has an id, it is unchanged
  isEmpty( Mixed value, [Boolean allowBlank] ) : Boolean Ext
Returns true if the passed value is null, undefined or an empty string (optional).
  namespace( String namespace1, String namespace2, String etc ) : void Ext
Creates namespaces to be used for scoping variables and classes so that they are not global. Usage: Ext.namespace('C...
  onReady( Function fn, Object scope, boolean override ) : void Ext
Fires when the document is ready (before onload and before images are loaded). Shorthand of Ext.EventManager.onDocum...
  override( Object origclass, Object overrides ) : void Ext
Adds a list of functions to the prototype of an existing class, overwriting any existing methods with the same name. ...
  query( String path, [Node root] ) : Array Ext
Selects an array of DOM nodes by CSS/XPath selector. Shorthand of Ext.DomQuery.select
  select( String/Array selector, [Boolean unique], [HTMLElement/String root] ) : CompositeElementLite/CompositeElement Ext
Selects elements based on the passed CSS selector to enable working on them as 1.
  type( Mixed object ) : String Ext
Returns the type of object that is passed in. If the object passed in is null or undefined it return false otherwise ...
  urlDecode( String string, [Boolean overwrite] ) : Object Ext
Takes an encoded URL and and converts it to an object. e.g. Ext.urlDecode("foo=1&bar=2"); would return {foo: 1, bar: ...
  urlEncode( Object o ) : String Ext
Takes an object and converts it to an encoded URL. e.g. Ext.urlEncode({foo: 1, bar: 2}); would return "foo=1&bar=2". ...

Public Events

This class has no public events.

Property Details

BLANK_IMAGE_URL

public String BLANK_IMAGE_URL
URL to a 1x1 transparent gif image used by Ext to create inline icons with CSS background images. (Defaults to "http://extjs.com/s.gif" and you should change this to a URL on your server).
This property is defined by Ext.

SSL_SECURE_URL

public String SSL_SECURE_URL
URL to a blank file used by Ext when in secure mode for iframe src and onReady src to prevent the IE insecure content warning (defaults to javascript:false).
This property is defined by Ext.

enableGarbageCollector

public Boolean enableGarbageCollector
True to automatically uncache orphaned Ext.Elements periodically (defaults to true)
This property is defined by Ext.

enableListenerCollection

public Boolean enableListenerCollection
True to automatically purge event listeners after uncaching an element (defaults to false). Note: this only happens if enableGarbageCollector is true.
This property is defined by Ext.

isBorderBox

public Boolean isBorderBox
This property is defined by Ext.

isGecko

public Boolean isGecko
This property is defined by Ext.

isIE

public Boolean isIE
This property is defined by Ext.

isIE7

public Boolean isIE7
This property is defined by Ext.

isLinux

public Boolean isLinux
This property is defined by Ext.

isMac

public Boolean isMac
This property is defined by Ext.

isOpera

public Boolean isOpera
This property is defined by Ext.

isReady

public Boolean isReady
True when the document is fully initialized and ready for action
This property is defined by Ext.

isSafari

public Boolean isSafari
This property is defined by Ext.

isSecure

public Boolean isSecure
True if the page is running over SSL
This property is defined by Ext.

isStrict

public Boolean isStrict
True if the browser is in strict mode
This property is defined by Ext.

isWindows

public Boolean isWindows
This property is defined by Ext.

useShims

public Boolean useShims
By default, Ext intelligently decides whether floating elements should be shimmed. If you are using flash, you may want to set this to true.
This property is defined by Ext.

Method Details

addBehaviors

public function addBehaviors( Object obj )
Applies event listeners to elements by selectors when the document is ready. The event name is specified with an @ suffix.
Ext.addBehaviors({
   // add a listener for click on all anchors in element with id foo
   '#foo a@click' : function(e, t){
       // do something
   },

   // add the same listener to multiple selectors (separated by comma BEFORE the @)
   '#foo a, #bar span.some-class@mouseover' : function(){
       // do something
   }
});
Parameters:
  • obj : Object
    The list of behaviors to apply
Returns:
  • void
This method is defined by Ext.

apply

public function apply( Object obj, Object config, Object defaults )
Copies all the properties of config to obj.
Parameters:
  • obj : Object
    The receiver of the properties
  • config : Object
    The source of the properties
  • defaults : Object
    A different object that will also be applied for default values
Returns:
  • Object
    returns obj
This method is defined by Ext.

applyIf

public function applyIf( Object obj, Object config )
Copies all the properties of config to obj if they don't already exist.
Parameters:
  • obj : Object
    The receiver of the properties
  • config : Object
    The source of the properties
Returns:
  • Object
    returns obj
This method is defined by Ext.

decode

public function decode()
Shorthand for Ext.util.JSON.decode
Parameters:
  • None.
Returns:
  • void
This method is defined by Ext.

each

public function each( Array/NodeList/Mixed array, Function fn, Object scope )
Iterates an array calling the passed function with each item, stopping if your function returns false. If the passed array is not really an array, your function is called once with it. The supplied function is called with (Object item, Number index, Array allItems).
Parameters:
  • array : Array/NodeList/Mixed
  • fn : Function
  • scope : Object
Returns:
  • void
This method is defined by Ext.

encode

public function encode()
Shorthand for Ext.util.JSON.encode
Parameters:
  • None.
Returns:
  • void
This method is defined by Ext.

escapeRe

public function escapeRe( String str )
Escapes the passed string for use in a regular expression
Parameters:
  • str : String
Returns:
  • String
This method is defined by Ext.

extend

public function extend( Object subclass, Object superclass, [Object overrides] )
Extends one class with another class and optionally overrides members with the passed literal. This class also adds the function "override()" to the class that can be used to override members on an instance.
Parameters:
  • subclass : Object
    The class inheriting the functionality
  • superclass : Object
    The class being extended
  • overrides : Object
    (optional) A literal with members
Returns:
  • void
This method is defined by Ext.

fly

public function fly( String/HTMLElement el, [String named] )
<static> Gets the globally shared flyweight Element, with the passed node as the active element. Do not store a reference to this element - the dom node can be overwritten by other code. Shorthand of Ext.Element.fly
Parameters:
  • el : String/HTMLElement
    The dom node or id
  • named : String
    (optional) Allows for creation of named reusable flyweights to prevent conflicts (e.g. internally Ext uses "_internal")
Returns:
  • Element
    The shared Element object
This method is defined by Ext.

get

public function get( String/HTMLElement/Element el )
Static method to retrieve Element objects. Uses simple caching to consistently return the same object. Automatically fixes if an object was recreated with the same id via AJAX or DOM. Shorthand of Ext.Element.get
Parameters:
  • el : String/HTMLElement/Element
    The id of the node, a DOM Node or an existing Element.
Returns:
  • Element
    The Element object
This method is defined by Ext.

getCmp

public function getCmp( String id )
Shorthand for Ext.ComponentMgr.get
Parameters:
  • id : String
Returns:
  • Ext.Component
This method is defined by Ext.

getDom

public function getDom( String/HTMLElement/Ext.Element el )
Return the dom node for the passed string (id), dom node, or Ext.Element
Parameters:
  • el : String/HTMLElement/Ext.Element
Returns:
  • HTMLElement
This method is defined by Ext.

id

public function id( [String/HTMLElement/Element el], [String prefix] )
Generates unique ids. If the element already has an id, it is unchanged
Parameters:
  • el : String/HTMLElement/Element
    (optional) The element to generate an id for
  • prefix : String
    (optional) Id prefix (defaults "ext-gen")
Returns:
  • String
    The generated Id.
This method is defined by Ext.

isEmpty

public function isEmpty( Mixed value, [Boolean allowBlank] )
Returns true if the passed value is null, undefined or an empty string (optional).
Parameters:
  • value : Mixed
    The value to test
  • allowBlank : Boolean
    (optional) Pass true if an empty string is not considered empty
Returns:
  • Boolean
This method is defined by Ext.

namespace

public function namespace( String namespace1, String namespace2, String etc )
Creates namespaces to be used for scoping variables and classes so that they are not global. Usage:
Ext.namespace('Company', 'Company.data');
Company.Widget = function() { ... }
Company.data.CustomStore = function(config) { ... }
Parameters:
  • namespace1 : String
  • namespace2 : String
  • etc : String
Returns:
  • void
This method is defined by Ext.

onReady

public function onReady( Function fn, Object scope, boolean override )
Fires when the document is ready (before onload and before images are loaded). Shorthand of Ext.EventManager.onDocumentReady.
Parameters:
  • fn : Function
    The method the event invokes
  • scope : Object
    An object that becomes the scope of the handler
  • override : boolean
    If true, the obj passed in becomes the execution scope of the listener
Returns:
  • void
This method is defined by Ext.

override

public function override( Object origclass, Object overrides )
Adds a list of functions to the prototype of an existing class, overwriting any existing methods with the same name. Usage:
Ext.override(MyClass, {
    newMethod1: function(){
        // etc.
    },
    newMethod2: function(foo){
        // etc.
    }
});
Parameters:
  • origclass : Object
    The class to override
  • overrides : Object
    The list of functions to add to origClass. This should be specified as an object literal containing one or more methods.
Returns:
  • void
This method is defined by Ext.

query

public function query( String path, [Node root] )
Selects an array of DOM nodes by CSS/XPath selector. Shorthand of Ext.DomQuery.select
Parameters:
  • path : String
    The selector/xpath query
  • root : Node
    (optional) The start of the query (defaults to document).
Returns:
  • Array
This method is defined by Ext.

select

public function select( String/Array selector, [Boolean unique], [HTMLElement/String root] )
Selects elements based on the passed CSS selector to enable working on them as 1.
Parameters:
  • selector : String/Array
    The CSS selector or an array of elements
  • unique : Boolean
    (optional) true to create a unique Ext.Element for each element (defaults to a shared flyweight object)
  • root : HTMLElement/String
    (optional) The root element of the query or id of the root
Returns:
  • CompositeElementLite/CompositeElement
This method is defined by Ext.

type

public function type( Mixed object )
Returns the type of object that is passed in. If the object passed in is null or undefined it return false otherwise it returns one of the following values:
  • string: If the object passed is a string
  • number: If the object passed is a number
  • boolean: If the object passed is a boolean value
  • function: If the object passed is a function reference
  • object: If the object passed is an object
  • array: If the object passed is an array
  • regexp: If the object passed is a regular expression
  • element: If the object passed is a DOM Element
  • nodelist: If the object passed is a DOM NodeList
  • textnode: If the object passed is a DOM text node and contains something other than whitespace
  • whitespace: If the object passed is a DOM text node and contains only whitespace
    Parameters:
    • object : Mixed
    Returns:
    • String
This method is defined by Ext.

urlDecode

public function urlDecode( String string, [Boolean overwrite] )
Takes an encoded URL and and converts it to an object. e.g. Ext.urlDecode("foo=1&bar=2"); would return {foo: 1, bar: 2} or Ext.urlDecode("foo=1&bar=2&bar=3&bar=4", true); would return {foo: 1, bar: [2, 3, 4]}.
Parameters:
  • string : String
  • overwrite : Boolean
    (optional) Items of the same name will overwrite previous values instead of creating an an array (Defaults to false).
Returns:
  • Object
    A literal with members
This method is defined by Ext.

urlEncode

public function urlEncode( Object o )
Takes an object and converts it to an encoded URL. e.g. Ext.urlEncode({foo: 1, bar: 2}); would return "foo=1&bar=2". Optionally, property values can be arrays, instead of keys and the resulting string that's returned will contain a name/value pair for each array value.
Parameters:
  • o : Object
Returns:
  • String
This method is defined by Ext.

Ext - Copyright © 2006-2007 Ext JS, LLC
All rights reserved.

Json encode ..

json string을 json object로 반드는 케이스
jsonData = Ext.util.JSON.decode("{'total_rows':4,'list':[{'trans_date_pos':'2008-4-4','domain':'test','warehouse':'K','qty':13},{'trans_date_pos':'2008-4-4','domain':'test','warehouse':'K','qty':13},{'trans_date_pos':'2008-4-4','domain':'test','warehouse':'K','qty':13},{'trans_date_pos':'2008-4-4','domain':'test','warehouse':'K','qty':13},{'trans_date_pos':'2008-4-5','domain':'test','warehouse':'K','qty':13},{'trans_date_pos':'2008-4-5','domain':'test','warehouse':'K','qty':13},{'trans_date_pos':'2008-4-5','domain':'test','warehouse':'K','qty':13}]}");
 
생성된 json object를 store에 저장함
// ext.data.groupingstore는 해당 자료를 grouping하기 위해 store대신 사용함
    store = new Ext.data.GroupingStore({       
        reader: new Ext.data.JsonReader({
            totalProperty: 'total_rows',
            root: "list",
            fields: ["trans_date_pos","domain","warehouse","qty"]
        }),
        data: jsonData,
        groupField:'trans_date_pos',
        autoLoad: true
    });


2008년 4월 4일 금요일

작고 견고한 우산이 갖고 싶다..

맘에 드는 우산이 자꾸 없어진다. --;

이젠 전용 우산을 하나 갖고 싶은데 너무 비싸네..

http://www.dcx.co.kr/item/item_detail.asp?itemcd=000000033952

more..


책을 읽을때 명심해야 한는 것들

예병일의 노트를 받아 보고 있다. 오늘 참 좋은 글이 와서 적어 놓고 행동에 옮기고자 한다.

 1. 책을 읽은 후에는 반드시 느낌을 정리하는 것이 중요함

 2. 읽으면서 공감하거나 생각이 다른 부분은 과감히 표시하거나 접어두라, 책은 실용을 위한 도구일 뿐이다.
   
 3. 책은 읽고 끝내지 말고, 읽으면서 항상 자신의 노트에 주요 부분을 메모하고 생각과 느낌을 적어 놓아야 합니다.
 
 4. 그렇게 자신의 생각, 자신의 언어로 노트를 해야 온전히 나의 지식으로 소화해낼 수 있습니다.
 

2008년 4월 3일 목요일

메시지 창 api와 예제

메뉴얼 사이트: http://extjs.com/deploy/ext/docs/output/Ext.MessageBox.html#buttonText

사용자 삽입 이미지

Ext.Msg.show({
      title:'입고 전표 등록',
      msg: '입고 전표를 등록해 주십시요',
      buttons: Ext.Msg.OKCANCEL,
      icon: Ext.MessageBox.WARNING,
      fn: processResult,
      prompt: true,
      animEl: 'elId'
   });

animEl 이 뭔지 잘 모르겠네..

processResult function은 아래와 같이 되어 있음

function processResult( btn, text )
{
    alert ( 'result' + btn + text);
}




 btn: ok, cancel 이 들어오고
  text: 에는 prompt상에 입력한 값이 들어옴.




 

array concat 를 사용하다...array를 결합

<script type="text/javascript">

var arr = new Array(3);
arr[0] = "Jani";
arr[1] = "Tove";
arr[2] = "Hege";

var arr2 = new Array(3);
arr2[0] = "John";
arr2[1] = "Andy";
arr2[2] = "Wendy";

document.write(arr.concat(arr2));

</script>

json에서 사용한다면
var objJson = new object();
objJson.list = [1,2,3,4];

라고 하면 아래와 같은 구조로 만들어 질 것 같다.
objJson = { list:[1,2,3] } 이라고 가정하고

objJson.list.concat( arr2 ) 정도이면 될까?

여러개의 언어를 동시에 사용하다 보니..헛갈리네. 나참 다들 비슷해서리..

Array에 관한 테스트라고나 할까?

json을 준비 중..

<script language=javascript>
var a = new Array();
var b = new Object();
b.name = 'haha';

var c = new Object();
c.name = 'hoho';

a[0] = b;
a.push(c);

document.write( a[1].name );

</script>

test


push도 있고 slice도 있고 다 있구만, 내가 그전에도 이런걸 사용했었나?

Json사용을 위한 셋팅2

pear에서 json관련 라이브러리를 설치 하면
json_encode와 json_decode를 아무데서나 call할 수 있는 환경이 된다.
하..지..만 설치가 되지 않는 경우도 있다.


<?php
if ( !function_exists('json_decode'
) ){
    function
json_decode($content, $assoc=false
){
                require_once
'Services/JSON.php'
;
                if (
$assoc
){
                   
$json = new Services_JSON(SERVICES_JSON_LOOSE_TYPE
);
        } else {
                   
$json = new Services_JSON
;
                }
        return
$json->decode($content
);
    }
}

if ( !
function_exists('json_encode'
) ){
    function
json_encode($content
){
                require_once
'Services/JSON.php'
;
               
$json = new Services_JSON
;
               
        return
$json->encode($content
);
    }
}
?>
참조 사이트: http://pear.php.net/pepr/pepr-proposal-show.php?id=198


[json] Json 방식으로 Ajax request

먼저 json방식의 자료를 만들어야겠다.

array일 경우
var Beatles = ["Paul","John","George","Ringo"];
var Beatles = new Array("Paul","John","George","Ringo");

Object일 경우
var Beatles = {
     "Country" : "England",
     "YearFormed" : 1959,
     "Style" : "Rock'n'Roll"
}

아래의 경우는 위와 동일함
var Beatles = new Object();
Beatles.Country = "England";
Beatles.YearFormed = 1959;
Beatles.Style = "Rock'n'Roll";

Object 출력
alert(Beatles.Style); //Dot Notation
alert(Beatles["Style"]); //Bracket Notation


Array를 Object에 사용할 경우
var Beatles = {
     "Country" : "England",
     "YearFormed" : 1959,
     "Style" : "Rock'n'Roll",
     "Members" : ["Paul","John","George","Ringo"]
}


Array내부에 Object사용
var Rockbands = [
     {
         "Name" : "Beatles",
         "Country" : "England",
         "YearFormed" : 1959,
         "Style" : "Rock'n'Roll",
         "Members" : ["Paul","John","George","Ringo"]
     }
,
    {
        "Name" : "Rolling Stones",
        "Country" : "England",
        "YearFormed" : 1962,
        "Style" : "Rock'n'Roll",
         "Members" : ["Mick","Keith","Charlie","Bill"]
      }

]

Json Syntax
Javascript Object 와 흡사함

{
"Name" : "Beatles",
"Country" : "England",
"YearFormed" : 1959,
"Style" : "Rock'n'Roll",
"Members" : ["Paul","John","George","Ringo"]
}

내가 원하는것은 만들어진 Json을 어떻게 Ajax를 사용해 전송 할 것인가? 하는 것이다.
그 전에 Json Parser란게 필요하다.
사실 eval( ) 을 사용해서 parsing을 하고 있었는데 parser를 쓰면 더 좋단다. 흠흠..

http://www.json.org/json.js

  • JSON.parse(strJSON) - converts a JSON string into a JavaScript object.
  • JSON.stringify(objJSON) - converts a JavaScript object into a JSON string.
  • 순서는 다음과 같다.
    Client Side
    1. Json을 만든다.
    2. Json파서를 사용해 stringify() 작업을 한다. 이건 object를 string으로 만들어 버리겠다는것?
    3. Send the URL-encoded JSON string to the server as part of the HTTP Request

    Sample:

    var objJSON = {
       "msg" : MSG
      };
      var strJSON = encodeURIComponent(JSON.stringify(objJSON));
      new Ajax.Request("ReceiveJSON.jsp",
       {
        method: "post",
        parameters: "strJSON=" + strJSON,
        onComplete: Respond
       });


    Server Side(php)
    strJSON 파라미터를 받아서 json_decode() 하게 되면 array의 형식으로 변경됨.
    알아서 작업하면 됨....

    -------------------------
    헌데 분명
    Content_Type     => 'application/json',
    Content              => $json_req,
    의 방법을 이용한 경우가 있는데 이럴때는 서버측에서 어떻게 해야 하나?





     



    4월 첫번째 주

    토요일 (5일)
    안 방의 책장을 마루로 빼기로 함.
      그러면 마루가 뭐가 되는거지? 흠흠..

    일요일
      아기들과 어린이 대공원을 가기로 함. 차를 가져가야 하나? 아니면 그냥 지하철 타고 가면 되나?
      지하철 타고 가고 싶다..^^;
      사진도 찍어주고 동물들도 보고 혜승인 또 풍선을 사달라고 난리칠 것 같다.

       점심은 사먹어야 하나 싸 가야 하나?

    2008년 4월 2일 수요일

    이상한 전화를 받았다.

    때르릉..
    평소 고객 전화가 많은지라 "감사합니다" 하며 전화를 받았다.

    수화기로 어눌한 말투의 "여보세요"
    "여보세요 여기가 어디예요?" 흠 이게 무슨 소리인가? 뜬금없이 여기가 어디냐니?
    또 다시 "여기가 어디예요?" 흠...

    "여기 사고 났어요"

    Ajax Json으로 값을 받아온 combo

    data를 서버로 부터 받아오는 경우

    // 택배사 콤보 박스 출력
        m_params['template']    = "E900";
        m_params['action']      = "get_transcode";
        transcorp_store = new Ext.data.Store({
            proxy: new Ext.data.HttpProxy(
                       new Ext.data.Connection({
                            url: './function.htm',
                            extraParams: m_params,
                            method: 'POST'
                    })),
            reader: new Ext.data.JsonReader({
                root: "corp_list",
                fields: ["id", "trans_corp"]
            }),
            autoLoad:true
        });

    // combo box 출력
        m_combo = new Ext.form.ComboBox({
                name: "combo_trans_corp",
                fieldLabel: '택배사',
                mode:'local',       // 중요
                displayField:'trans_corp',
                valueField:'id',
                store: transcorp_store,
                emptyText:'Select a 택배사...'
        });


    사용자 삽입 이미지


    기본 combo 만들기 - 값 설정 가능

    기본 콤보 생성
    값을 임의로 설정할 수 있는 콤보
    case 1
    var combo_transwho = new Ext.form.ComboBox({
                name: "combo_transwho",
                fieldLabel: '선착불',
                store: new Ext.data.SimpleStore({
                    fields: ['id', 'disp'],
                    data : [
                        ['고객','고객부담'],
                        ['자사','자사부담']
                    ]
                }),
                valueField:'id',
                displayField:'disp',
                typeAhead: true,
                mode: 'local',
                triggerAction: 'all',
                emptyText:'Select 선착불...',
                selectOnFocus:true
        });

    사용자 삽입 이미지


    case 2
                // 일반 콤보           
                this.combo_common = function( title, id, arr_data )
                {
                    var _store = new Ext.data.SimpleStore({
                        fields: ['id', 'value'],
                        data : arr_data // from states.js
                    });

                    o = new Ext.form.ComboBox({
                        name: id,
                        id: id,
                        width: 90,
                        hideLabel: true,
                        store: _store,
                        emptyText: title,
                        displayField:'value',
                        valueField: 'id',
                        mode: 'local',
                        editable:false,
                        triggerAction:'all'
                    })
                   
                    return o;
                }

    2008년 4월 1일 화요일

    날짜 계산

    # Date::Simple 을 사용하면 쉽게 계산 할 수 있다.
    use Date::Simple ('date', 'today');

    my $today = today();
    my $yesterday = $today - 1;
    my $start_date = $today - 15;