Show Posts
				 | 
			 
			
				| 
					Pages: [1] 2 3 4 
				 | 
			 
		 
		
			
				
					
						
							| 
								1
							 | 
							
								 General Category / EasyUI for jQuery / datagrid load xml data and the sort problem.
							 | 
							
								on: October 08, 2018, 11:06:02 PM
							 | 
						 
						
							
								I use the xml data and the data remoteSort=false, when click the title,the data is disappear.              loader: function (param, success, error) {                 var opts = $(this).datagrid('options');                 if (!opts.url) return false;                 $.ajax({                     type: opts.method,                     url: opts.url,                     data: param,                     dataType: 'xml',                     success: function (data) {                         success(data);                     },                     error: function () {                         error.apply(this, arguments);                     }                 });             },             loadFilter: function (xml) {                 var dgparam = $(xml).find("datagrid");                 var rows = [];                 $(xml).find('rows').each(function () {                     var xmlcolumn = $(this);                     var rowdata = {};                     $(xmlcolumn).children().each(function () {                         rowdata[$(this).context.nodeName] = xmlcolumn.find($(this).context.nodeName).text();                     });                     rows.push(rowdata);                 });                 return { total: $(dgparam).attr("total"), rows: rows };             },  
							 | 
						 
						
							| 
							 | 
						 
					 
				 | 
			 
		 
		
		
			
				
					
						
							| 
								3
							 | 
							
								 General Category / EasyUI for jQuery / Re: How do Datagrid bind xml?
							 | 
							
								on: February 08, 2018, 06:06:19 PM
							 | 
						 
						
							
								If my service return xml,the loadFilter method is not working. I print the data,but it is no function. url: '/Offices/DataDictionary/Reload',             method: 'get',              dataType: "json",// actually service return xml.
 
  loadFilter: function (data) {                 console.log(data);            }
   
							 | 
						 
						
							| 
							 | 
						 
					 
				 | 
			 
		 
		
			
				
					
						
							| 
								4
							 | 
							
								 General Category / EasyUI for jQuery / Re: How do Datagrid bind xml?
							 | 
							
								on: February 08, 2018, 02:26:31 AM
							 | 
						 
						
							
								Yes,I had read this page. I don't now the loadFilter is after load data working? Because my Service  return xml data, I konw need use loadFilter  transfer to json. but I console the xml,this no data show,actually it data is return.  
							 | 
						 
						
							| 
							 | 
						 
					 
				 | 
			 
		 
		
			
				
					
						
							| 
								5
							 | 
							
								 General Category / EasyUI for jQuery / How do Datagrid bind xml?
							 | 
							
								on: February 08, 2018, 01:45:38 AM
							 | 
						 
						
							
								The datagrid request data type is xml,I want use loadFilter parse bind. I debug console.log(xml); but no data console.          $('#gridmaster').datagrid({             title: '',             url: '/Offices/Dictionary/Reload',             method: 'get',             //dataType: "json",             fit: true,             toolbar: '#tb',             fitColumns: true,             rownumbers: true,              striped: true,             autoRowHeight: false,             pageSize: 20,             pagination: true,              remoteSort: false,             pageNumber: 1,              pageList: [20,100,200,500],             columns: [[                 { field: 'did', hidden: true, title: 'ID' },                 { field: 'name', title: 'Name', width: '110px', sortable: true },                 { field: 'desc', title: 'Descrition', width: '110px' }             ]],             queryParams: {                 formid: '0',                 pid: '0',             },             singleSelect: true,             selectOnCheck: false,             checkOnSelect: false,             onLoadSuccess: function (data) {             },             onDblClickRow: function (rowIndex, rowData) {                 doEditPage('view');             },             loadFilter: function (xml) {                 console.log(xml);            }         });
  
							 | 
						 
						
							| 
							 | 
						 
					 
				 | 
			 
		 
		
			
				
					
						
							| 
								6
							 | 
							
								 General Category / EasyUI for jQuery / Re: Json content contain json,how can display in datagrid?
							 | 
							
								on: December 21, 2017, 11:07:42 PM
							 | 
						 
						
							
								Please define the 'loadFilter' function to convert the original data source. $('#dg').datagrid({ 	loadFilter: function(data){ 		var sites = data.rows[0].contents.sites; 		return { 			total: sites.length, 			rows: sites 		}; 	} })
 Sorry,maybe I am not clear my question,the content is richtext,sometime this json or html. So,I don't know how can display the field what ever the text content type.  
							 | 
						 
						
							| 
							 | 
						 
					 
				 | 
			 
		 
		
			
				
					
						
							| 
								7
							 | 
							
								 General Category / EasyUI for jQuery / Json content contain json,how can display in datagrid?
							 | 
							
								on: November 23, 2017, 11:42:47 PM
							 | 
						 
						
							
								One row json,here one column name is content,and this content is json. so,it's can not display in datagrid? {"total":1,"rows":[{"syssmsid":"5685","syssmssendid":"13603","title":"test","contents":"{  "sites": [  { "name":"facebook" , "url":"www.facebook.com" },   { "name":"google" , "url":"www.google.com" },   { "name":"google plus" , "url":"www.google.com" }  ]  }","builddate":"2017-11-23 17:18:59","emname_st":"Name","type":"2","builder":"1","flag":"False","rownumber":"1"}]}
 "contents":"{  "sites": [  { "name":"facebook" , "url":"www.facebook.com" },   { "name":"google" , "url":"www.google.com" },   { "name":"google plus" , "url":"www.google.com" }  ]  }"
  
							 | 
						 
						
							| 
							 | 
						 
					 
				 | 
			 
		 
		
		
		
			
				
					
						
							| 
								10
							 | 
							
								 General Category / EasyUI for jQuery / Re: Add 2  combobox in one datagrid column
							 | 
							
								on: August 10, 2016, 01:55:15 AM
							 | 
						 
						
							
								I think it's no problem. The column you can use the formatter attributes.  Like the bottom codes,You can use the value and set the html element. this is just a sample, you can use the same method get it.                     { field: 'views', title: 'View', width: 50,                         formatter: function (value, rec, rowIndex) {                             if(value=='1'){                                 return "<input type=\"checkbox\" id=\"gpcheckboxd"+rec.id+"\"  name=\"gpcheckboxd"+rec.id+"\" onclick=\"checkboxListener("+rec.id+",'gp')\" value='"+value+"' checked='true'>";                             }                             else{                                 return "<input type=\"checkbox\" id=\"gpcheckboxd"+rec.id+"\"  name=\"gpcheckboxd"+rec.id+"\" onclick=\"checkboxListener("+rec.id+",'gp')\" value='"+value+"'>";                             }                         } }
  
							 | 
						 
						
							| 
							 | 
						 
					 
				 | 
			 
		 
		
		
		
		
			
				
					
						
							| 
								14
							 | 
							
								 General Category / EasyUI for jQuery / How to updateRow datagrid cell value by variable name?
							 | 
							
								on: May 19, 2016, 07:17:32 AM
							 | 
						 
						
							
								Datagrid hava 4 cell field,1 row. I need set the same value.but if var name='name'+i; the value no change.   function  setInitValue(){     for(var i=0;i<5;i++){     var name='name'+i;     $('#dg').datagrid('beginEdit', 0);     $('#dg').datagrid('updateRow',{                                     index:0,                                     row:{                                         name:'My name is frank'                                     }                                 });                                 $('#name').datagrid('endEdit', 0);         }     $('#dg').datagrid('acceptChanges');  }
 
 { field: 'name0', title: 'Name0', width: '120px', sortable: true }, { field: 'name1', title: 'Name1', width: '120px', sortable: true }, { field: 'name2', title: 'Name2', width: '150px', sortable: true }, { field: 'name3', title: 'Name3', width: '150px', sortable: true }, { field: 'name4', title: 'Name4', width: '150px', sortable: true },
  
							 | 
						 
						
							| 
							 | 
						 
					 
				 | 
			 
		 
		
		
				 |