Checkbox Determine Editable Column

QuestionsCheckbox Determine Editable Column
Hafiz asked 6 years ago

Hello Abu,

Is it possible to make a column editable and not editable based on the checkbox?

Here i attach a picture for your reference.

The edit-ability of the column at bottom of picture is determined by the checkbox at the top of picture.

Is there anyway to make this possible?

 

Regards

5 Answers
Abu Ghufran Staff answered 6 years ago

Dear Hafiz, attachment image is missing. Kindly update ticket with image.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Hafiz answered 6 years ago

Hello,

Sorry for the attachment, here i attached the attachment.

Link: https://imgur.com/a/9Wm4jxn

Abu Ghufran Staff answered 6 years ago

Refer this demo. It uses dropdown option to show hide next 2 fields.

https://gist.github.com/gridphp/e1ee390bd3bbabb372958f9fea7a30b8

line 31,32,191

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Hafiz answered 6 years ago

So,

It’s basically impossible to hide a column using “checkbox”. Anyway, thanks for helping.

Abu Ghufran Staff answered 6 years ago

It is doable. What you can do is to connect onclick function with checkbox column like:

$col[“editoptions”][“onclick”] = “function(obj){ setup_fields(obj); }”;

And in setup_fields() JS function, you can hide / show rows just like above demo code Line 191 by checking value of checkbox using jquery OR passed object.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Your Answer

2 + 20 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?