Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
Disabling checkbox in "multiselect:true" mode for a specific row in jqgrid
31/08/2009
06:20
Avatar
arkachattopadhyay
Member
Members
Forum Posts: 8
Member Since:
12/08/2009
sp_UserOfflineSmall Offline

I am showing some data in jqgrid and I am using the option "multiselect:true".In the grid, for a specific row, I want the checkbox not to be show or if it is shown then it should be disabled.Can I do this??I am using jqgrid3.5.2.

Thanks in advance.

31/08/2009
10:13
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

Every checkbox has uniquie id which is combination of

"jqg_"+rowid - where the rowid is the id of the row.

Use the appropriate command to disable it.

Best Regards

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

01/09/2009
02:29
Avatar
arkachattopadhyay
Member
Members
Forum Posts: 8
Member Since:
12/08/2009
sp_UserOfflineSmall Offline

Many many thanks to you.It is working perfectly.Thank you once again.

01/09/2009
18:48
Avatar
varun
Member
Members
Forum Posts: 3
Member Since:
30/08/2009
sp_UserOfflineSmall Offline

Hi Tony

I am disabling the checkbox using

$("#jqg_Q391").attr("disabled", true);

But the problem is when i select the checkbox at the top it still checks the box in the disable state.

Is there any work around for it or i am missing somthing?

Thanks

Varun

01/09/2009
19:53
Avatar
varun
Member
Members
Forum Posts: 3
Member Since:
30/08/2009
sp_UserOfflineSmall Offline

After doing some research i tried something like this.

$("[id^=jqg_][disabled='']",ts.rows).attr("checked",true);

and on the grid i was setting the disabled property as

$(”#jqg_Q391″).attr(”disabled”, "true");

so that it doesn't check the boxes which i have disabled.

But when i click anywhere on the disabled row or i click on the top checkbox it highlights the rows and still sends me the rowId of the rows where checkbox is disabled.

Varun

28/10/2009
19:49
Avatar
rl9022
Guest
Guests

is there any update to this???

29/10/2009
11:37
Avatar
varun
Guest
Guests

I had to add this line in the setSelection method.

..........................................................................................

if( $("#jqg_"+pt[ 0 ].id).attr("disabled") ){
                        return;
                    }

.....................................................................................................

after these lines

$t.p.selrow = selection;
                ia = $.inArray($t.p.selrow,$t.p.selarrrow);
                if (  ia === -1 ){   

      ///////////////// Modified code here ???????????????????????????????

-----

----

29/10/2009
12:53
Avatar
markw65
Member
Members
Forum Posts: 179
Member Since:
30/07/2009
sp_UserOfflineSmall Offline

Rather than modifying grid code, you could use a beforeSelectRow handler...

Mark

29/10/2009
13:50
Avatar
varun
Guest
Guests

This is the correct behavior that the grid should take action. If the checkbox is disabled it should not select the rows, if it is doing it then that is not the proper behavior. Moreover wherever you have implemented that code to disable the checkbox each time you have to call "beforeSelectRow" handler.

Varun

30/10/2009
20:24
Avatar
markw65
Member
Members
Forum Posts: 179
Member Since:
30/07/2009
sp_UserOfflineSmall Offline

Yes, you're right - it would be good if the grid supported it directly.

But a lot of people want to use the prebuilt compressed grid code - so a solution that doesnt involve changing grid code is also useful.

Mark

31/10/2009
00:10
Avatar
rl9022
Member
Members
Forum Posts: 7
Member Since:
28/10/2009
sp_UserOfflineSmall Offline

varun:

I tried adjusting jquery.jqGrid.min.js but now when I try to load jqgrid.html it doesn't load.

31/10/2009
03:18
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

Will see what I can do.

The problem that I see is: if the row is selected and we disable the selection on that row (by example attaching a certain class) what we should do? I do not want to write additional method for this just to analyze if it has certain class  – i.e 

(”#myrow”,”#mygrid).addClass(”not-selected-row”)

I have answered to mayself (maybe) : before doing this we should check if the row is selected

Best Regards

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

31/10/2009
08:14
Avatar
rl9022
Member
Members
Forum Posts: 7
Member Since:
28/10/2009
sp_UserOfflineSmall Offline

Tony:

I'm not entirely clear on how jqGrid works, but should this be a css issue or an html issue?  To me it should be html where there is no chance of checking the box, like:

<INPUT TYPE="CHECKBOX" NAME="box1" VALUE="ok" DISABLED>

31/10/2009
08:35
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

What I mean we should provide a mechanizm not to select a row instead if multiselect is set to true or false.

Regards

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

31/10/2009
08:39
Avatar
rl9022
Member
Members
Forum Posts: 7
Member Since:
28/10/2009
sp_UserOfflineSmall Offline

I think people would find that useful.

31/10/2009
08:50
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

In order to be a clear what should be done.

When we disable a a row:

1.if the row is selected - deselect it

2. mark a row as not selectable

3. if we are in multi select mode - make the check box disabled.

4. If we click on the common check box - do not allow this row to be selected

5. set  logic when we are in cellEdit not to allow editing.

6. set logic when we are inline edit not to edit that row

7. set logic in form edit not to load data an this row.

I think that this cover all the cases.

Best Regards

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

31/10/2009
10:04
Avatar
rl9022
Member
Members
Forum Posts: 7
Member Since:
28/10/2009
sp_UserOfflineSmall Offline

I believe you've covered all the bases.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
64 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

OlegK: 1255

markw65: 179

kobruleht: 144

phicarre: 132

YamilBracho: 124

Renso: 118

Member Stats:

Guest Posters: 447

Members: 11373

Moderators: 2

Admins: 1

Forum Stats:

Groups: 1

Forums: 8

Topics: 10592

Posts: 31289

Newest Members:

, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information