First of all, I hope this is the right place to ask questions specific
to the SelectShuttle widget. If not, please direct me to where I
should post my question, and sorry for the noise. If so, please read
on.
I have been using the SelectShuttle widget successfully for some time
now and am very happy that such a widget exists. It makes things
really easy to setup. My problem is that I have a need that
SelectShuttle doesn't seem to support. I'll do my best to describe
what I'm looking for...
* I have a contacts database and want to assign contacts to certain
categories.
* Users are restricted as to which categories that can assign/unassign
a contact.
I would like to be able to disable the categories in the list that the
logged in user does not have access to. The category should still show
up in the 'selected' list, but the user should not be able to remove it
from that list.
In the example below, some users should not be able to add/remove the
'Contact Price Sheet' category, but if it is on a contact, all users
should be able to see it.
I played with this a bit and set the disabled option on the select
field when populating the widget as follows:
options.append((
ctg.id, '%s' % (
ctg.name),
dict(disabled="disabled")))
This works, disabling the row in the select field, but double clicking
on a disabled row just re-enables all the rows that were disabled. So,
it appears as though it is inheriting the disable feature from some
underlying widget, but does not make an attempt to honor a disabled
row.
I have not dug into the Select-Shuttle code (I'm not real good with
javascript) but was wondering if this would be considered as an
enhancement. Or, if I'm doing something incorrectly and this
capability is supported, could you point me to some doc or examples on
how to use it?
Thanks again, I love the widget, just trying to push the envelop a
bit...
-Jim