EasyUI Forum
April 19, 2024, 08:29:07 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
  Home Help Search Login Register  
  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.

Code:
            
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 };
            },
2  General Category / EasyUI for jQuery / Re: How do Datagrid bind xml? on: February 08, 2018, 09:12:59 PM
Thanks!
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.


Code:
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.


Code:
        $('#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.
Code:
$('#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?

Code:
{"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"}]}

Code:
"contents":"{  "sites": [  { "name":"facebook" , "url":"www.facebook.com" },   { "name":"google" , "url":"www.google.com" },   { "name":"google plus" , "url":"www.google.com" }  ]  }"
8  General Category / EasyUI for jQuery / Re: How to set the textbox style? on: August 19, 2016, 05:43:04 PM
        $('#t1').textbox('textbox').css('font-size', '18px');
        $('#t1').textbox('textbox').css('font-weight', 'bold');

Thanks,I use the method.
9  General Category / EasyUI for jQuery / How to set the textbox style? on: August 19, 2016, 01:08:06 AM
How to set the textbox fontsize?
like font-size:16px;font-weight:bold;
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.

Code:
                    { 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+"'>";
                            }
                        } }
11  General Category / EasyUI for jQuery / How to set the select row style for datagrid? on: August 10, 2016, 01:42:25 AM
I import the datagrid-cellediting.js extenstion library.
and I set the select rowindex,but the row backcolor not change.
12  General Category / EasyUI for jQuery / How to set the easyui-tree onDblClick expand and close the node? on: August 05, 2016, 02:47:52 AM
I need set the onDblClick expand and close the node.
How to do it? 
Thanks.
13  General Category / EasyUI for jQuery / How to set the easyui-textbox background color? on: July 30, 2016, 02:08:37 AM
When the textbox is readonly="readonly",i need set the background color red or blue.
how to do it? 
thanks!
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.
 
Code:
 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');
 }



Code:
{ 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 },
15  General Category / EasyUI for jQuery / Re: easyui-tabs close error:Uncaught TypeError: Cannot read property on: May 12, 2016, 01:48:52 AM
Thanks your reply,
I debug this again.
Pages: [1] 2 3 4
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!