EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: jega on May 02, 2025, 02:28:01 PM



Title: [SOLVED]Datagrid Change singleselect and keep title
Post by: jega on May 02, 2025, 02:28:01 PM
Hi

Have set title on datagrid with

var dgPanel = $('#dgList').datagrid('getPanel');
dgPanel.panel('setTitle',data.titleName);

When changing singleselect state with

$('#dgList').datagrid({
   singleSelect:true            
});

it destroys the title.

How to keep it without do a setTitle on panel again




Title: Re: Datagrid Change singleselect and keep title
Post by: jega on June 09, 2025, 02:41:21 PM
Any help ??


Title: Re: Datagrid Change singleselect and keep title
Post by: jarry on June 11, 2025, 05:01:00 AM
Call the code below will recreate the datagrid again.
Code:
$('#dgList').datagrid({
   singleSelect:true           
});
You can set the 'title' property while creating the datagrid.
Code:
$('#dgList').datagrid({
   title: '...',
   singleSelect:true           
});

If you only want to change the selecting mode, please set the 'singleSelect' property instead of recreating the whole datagrid again.
Code:
$('#dgList').datagrid('options').singleSelect=true;


Title: Re: Datagrid Change singleselect and keep title
Post by: jega on June 11, 2025, 11:03:38 PM
Hi jarry.

Ohh i see. Just use the options

Thanks