EasyUI
Home
Demo
Tutorial
Documentation
Download
Extension
Contact
Forum
EasyUI Forum
May 11, 2024, 08:09:52 AM
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
:
Home
Help
Search
Login
Register
EasyUI Forum
>
General Category
>
EasyUI for jQuery
>
Datagrid disable one or more row(s)
Pages: [
1
]
« previous
next »
Print
Author
Topic: Datagrid disable one or more row(s) (Read 8216 times)
sky-t
Full Member
Posts: 145
Datagrid disable one or more row(s)
«
on:
May 21, 2017, 12:09:08 AM »
Hi there,
is there a possibility to disable one or more rows in a datagrid?
Thanks for help!
Logged
jarry
Administrator
Hero Member
Posts: 2264
Re: Datagrid disable one or more row(s)
«
Reply #1 on:
May 21, 2017, 01:26:29 AM »
You can define the 'rowStyler' function to customize the style for some specified rows.
Logged
sky-t
Full Member
Posts: 145
Re: Datagrid disable one or more row(s)
«
Reply #2 on:
May 21, 2017, 02:00:19 AM »
Hi jarry,
first thank you - i know the rowStyler function - but how can i use it to disable a row?
Thanks again
Logged
jarry
Administrator
Hero Member
Posts: 2264
Re: Datagrid disable one or more row(s)
«
Reply #3 on:
May 21, 2017, 04:03:00 AM »
Use the 'rowStyler' to set the row style and use the 'onBeforeSelect' to determine whether a row can be selected. What is the purpose of disabling rows in datagrid?
Logged
sky-t
Full Member
Posts: 145
Re: Datagrid disable one or more row(s)
«
Reply #4 on:
May 21, 2017, 10:06:45 AM »
i want to show a list of all connected users - in this list i want the users to allow to select other users to send them a message for example. The current user is also in this list and i makes no sense if this user sends a message to himself.
Wo this row for each current user should be disabled.
Thank you jarry
Logged
jarry
Administrator
Hero Member
Posts: 2264
Re: Datagrid disable one or more row(s)
«
Reply #5 on:
May 21, 2017, 03:33:23 PM »
You only need to prevent the user from selecting some rows. Please return false in the onBeforeSelect event handler regarding some conditions.
Code:
$('#dg').datagrid({
onBeforeSelect:function(index,row){
if(...) return false
}
})
Logged
sky-t
Full Member
Posts: 145
Re: Datagrid disable one or more row(s)
«
Reply #6 on:
May 21, 2017, 09:22:55 PM »
Hi jarry,
thank you for your help - i think this way will work.
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> News
=> General Discussion
=> EasyUI for jQuery
=> EasyUI for Angular
=> EasyUI for Vue
=> EasyUI for React
=> Bug Report
Loading...