Hi Mark,
of cause you can somehow work around it …
I just checked the code again, the disabling of checkbox works like the
disabling of everything else, which is definitely working.
There’s probably some error with the name you entered for the widget or
a problem with the hierarchical construction of names.
You can add some debug code to etemplate/inc/class.uietemplate.inc.php
method show_cell() around line 990 in trunk:
if ($readonly = $cell[‘readonly’] || @$readonlys[$name] &&
!is_array($readonlys[$name]) || $readonlys[‘ALL’])
{
//
}
if ($cell[‘type’] == ‘checkbox’)
{
echo "
$form_name, $name --> ".(int)$readonly;
var_dump($readonlys[$name]);
}
Ralf
Mark Flach schrieb:
Ralf,
I was able to figure that one out, but the same issue exists. I added
another column in from of the column I’m using for my checkbox. All rows
appear, but I’m still not able to disable, or hide, the checkbox.
Perhaps we can go about this another way. Is it possible to replace the
checkbox with something like an image at run time? All I want to do is not
allow the user to un-check the checkbox if it is already checked. Maybe I
can replace the checkbox with an image of an “X” to show that it is checked
but not avaialble to change.
Mark <><
Ralf Becker-3 wrote:
Hi Mark,
the problem you describe is a different one, you have the checkbox as
first column. In that case you can not make it readonly, as that stops
the autorepeating …
You have to put something else in the first column.
Ralf
Mark Flach schrieb:
While I truly appreciate your patience on this, we are still not there
yet.
When I set the name of the checkbox to the name you suggested, I only get
one row of data displayed. Let me give you some additional data and see
if
this helps.
When I do a _debug_array($rows), this is an example of what I get:
Array
(
[1] => Array
(
[UID] => 55
[something] => 2
[more] => EB650082
)
[2] => Array
(
[UID] => 54
[something] => 1
[more] => LI601021
)
)
I assign $rows to $content like this:
$content[‘list’] = $rows;
When the page loads, the HTML that is produced is:
I try and make the checkbox “readonly” by the following command:
$readonlys[‘checked[55]’] = true;
Not only is the checkbox not readonly, only one row of data is displayed.
I hope this helps explain my situation. Also, I’m not sure it that
matters,
but I’m running 1.2.106
Mark <><
Ralf Becker-3 wrote:
what I usually do is:
$rows = array(
array(‘id’=>123,‘something’=>‘else’),
array(‘id’=>456,‘something’=>‘more’),
);
name of the checkbox is “checked[$row_cont[id]]”
and to disable the checkbox of the first row:
$readonlys[‘checked[123]’] = true;
Ralf
Mark Flach schrieb:
Sorry, didn’t work. I think I didn’t make something clear. The array
for
the grid is called “list”. I’d imagine that I have to reference "list"
somewhere in the readonlys array.
$content[‘list’] =$rows;
$readonlys[‘1[checked]’] = true;
Mark <><
Ralf Becker-3 wrote:
$readonlys[‘1[checked]’] = true;
Mark Flach schrieb:
Thanks Ralf. I was able to get it working like I wanted. The next
question
I have is how to set some of the checkboxes to readonly. I only want
the
user to be able to check those boxes that are not already checked.
Here
is
what I have and what I’ve tried:
Grid name: list
checkbox name: ${row}[checked]
I tried setting the $readonlys array to:
$readonlys[‘list’][1][‘checked’] = true;
but that didn’t work.
Any thoughts on what I should do?
Mark <><
Ralf Becker-3 wrote:
Hi,
Mark Flach schrieb:
Any idea how to set/get checkbox values when the checkbox is part
of
a
grid?
I have a checkbox widget with a name of checked[] and the option
value
set
to $row_cont[ID].
When I submit the form, I get the checkbox data as:
Array
(
[ID] => Array
(
[checked] => Array
(
[0] => 55
[1] => 54
)
)
[submit] => pressed
)
I’d prefer the have the data come back as [ID] => 55, but I can
work
with
this.
It’s always returned under the name your use …
The other problem is how to set the checkbox value to checked when
the page loads. This part I haven’t figured out yet.
if you use “checked[]” as name for multiple checkboxes, you can not
preset the values of the checkboxes.
To preset them you have to use explicitly named boxes, eg.
“checked[first]” and then you can use $content[‘checked’][‘first’] =
true; to set it.
Any HELP???
Sure
Ralf
Ralf Becker
eGroupWare Training & Support ==> http://www.egroupware-support.de
Outdoor Unlimited Training GmbH [www.outdoor-training.de]
Handelsregister HRB Kaiserslautern 3587
Geschäftsführer Birgit und Ralf Becker
Leibnizstr. 17, 67663 Kaiserslautern, Germany
Telefon +49 (0)631 31657-0
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft® Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
eGroupWare-developers mailing list
eGroupWare-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-developers
–
Ralf Becker
eGroupWare Training & Support ==> http://www.egroupware-support.de
Outdoor Unlimited Training GmbH [www.outdoor-training.de]
Handelsregister HRB Kaiserslautern 3587
Geschäftsführer Birgit und Ralf Becker
Leibnizstr. 17, 67663 Kaiserslautern, Germany
Telefon +49 (0)631 31657-0
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft® Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
eGroupWare-developers mailing list
eGroupWare-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-developers
–
Ralf Becker
eGroupWare Training & Support ==> http://www.egroupware-support.de
Outdoor Unlimited Training GmbH [www.outdoor-training.de]
Handelsregister HRB Kaiserslautern 3587
Geschäftsführer Birgit und Ralf Becker
Leibnizstr. 17, 67663 Kaiserslautern, Germany
Telefon +49 (0)631 31657-0
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft® Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
eGroupWare-developers mailing list
eGroupWare-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-developers
–
Ralf Becker
eGroupWare Training & Support ==> http://www.egroupware-support.de
Outdoor Unlimited Training GmbH [www.outdoor-training.de]
Handelsregister HRB Kaiserslautern 3587
Geschäftsführer Birgit und Ralf Becker
Leibnizstr. 17, 67663 Kaiserslautern, Germany
Telefon +49 (0)631 31657-0
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft® Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
eGroupWare-developers mailing list
eGroupWare-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-developers
–
Ralf Becker
eGroupWare Training & Support ==> http://www.egroupware-support.de
Outdoor Unlimited Training GmbH [www.outdoor-training.de]
Handelsregister HRB Kaiserslautern 3587
Geschäftsführer Birgit und Ralf Becker
Leibnizstr. 17, 67663 Kaiserslautern, Germany
Telefon +49 (0)631 31657-0
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft® Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
eGroupWare-developers mailing list
eGroupWare-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-developers