티스토리 뷰
728x90
반응형
Controller
public JsonResult currentWeather(string regionCode)
{
return Json( new { icon = "weather.png", regionName = "서울", etc = "35", weather = "맑음" } );
}
*.js
listeners: {
painted: function () {
var thisObj = this;
Ext.Ajax.request({
url: currentWeather,
params: { regionCode: '11B101010' },
method: 'post',
success: function (response) {
var data = Ext.JSON.decode(response.responseText.trim());
tpl = new Ext.XTemplate(
"<div>",
" <div style='float:left;'><img src='../../resources/icons/{icon}' style='width:140px; height:140px' alt='날씨 아이콘' /></div>",
" <div style='float:right;'><table><tr><td style='text-align:center'>{regionName}</td></tr><tr><td style='font-size:40px; font-weight:bold;'>{etc}℃</td></tr><tr><td style='font-size:30px; font-weight:bold; text-align:right;'>{weather}</td></tr></table></div>",
"</div>");
thisObj.setTpl(tpl);
thisObj.setData(data);
}
});
}
}
728x90
반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- 스프링 프레임워크(spring framewordk)
- 진수 변환
- java-개발 환경 설정하기
- jstl(java standard tag library)-core
- 문자 자르기
- 메이븐(maven)
- jsp 오픈 소스
- 제품 등록
- In App Purchase
- 스프링 프레임워크(spring framework)
- docker
- java 키워드 정리
- 인텔리제이(intellij)
- 특정 문자를 기준으로 자르기
- nl2br
- 람다식(lambda expression)
- React
- jstl(java standard tag library)
- java web-mvc
- 스프링 시큐리티(spring security)
- error-java
- 표현 언어(expression language)
- await
- java.sql
- system.io
- 스프링 시큐리티(spring security)-http basic 인증
- System.Diagnostics
- REST API
- .submit()
- MainActor
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
글 보관함