Checkbox Determine Editable Column

QuestionsCheckbox Determine Editable Column
Hafiz asked 2 months 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 2 months ago

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

_________________________
Abu Ghufran - Dev Team
PHP Grid Framework
 
Hafiz answered 2 months ago

Hello,

Sorry for the attachment, here i attached the attachment.

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

Abu Ghufran Staff answered 2 months 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
PHP Grid Framework
 
Hafiz answered 2 months ago

So,

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

Abu Ghufran Staff answered 2 months 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
PHP Grid Framework
 
Your Answer

8 + 16 =

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 / 5. Vote count:

As you found this post useful...

Follow us on social media!

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

Let us improve this post!