define(function(require) {
	//加载JS库
	var $ = require('jquery');
	var IFA = require('util');
	require('grid')($);
	require('dialog')($);
	require('uriTemplate')($);
	require('../../../styles/cim/jquery-ui-1.8.14.custom.css');
	require('../../../styles/cim/cim-grid.css');   
	$(function(){
		search();
		$("#search").bind("click",search);
	});
	function search(){
	var queryUrl = $("#searchUrl").val();
	var editUrl = new $.Template($("#editUrl").val());
	var updateUrl = $("#updateUrl").val();
	var grid = $("#mainPayMethodList").grid({
		url:queryUrl,
		root:"mainPayMethods",  
  		method:'POST',
  		isREST:false,
  		paging:false,
  		pageSize:50,
  		pageTheme:'Theme1',
  		defaultParams:$("#payMethodForm").serialize(),
  		fields:[
  				{
  					name:i18n['Entity.payMethod.name'],id:"name",style:"width:40%"
  				},
  				{
  					name:i18n['Entity.payMethod.value'],id:"value",style:"width:5%"
  				},
  				{
  					name:i18n['Entity.payMethod.descs'],id:"descs",style:"width:40%"
  				},
  				{name:i18n["Entity.Operation"],operation:[{text:i18n['Entity.page.edit'],display:true,action:function(data){
  				   var params = {'id':data.id};
  				   var url = editUrl.expand(params);
  				   location.href=url;
  				}}]
  				}
  				
  			]
  			
  		
		
	});
	}
	
	
	
});