In table view
I would like to create a function to disable line editing
if a field contains a certain value
TABLE_1
if field_2 = "closed"
disable editing of the whole row.
The detail view can only be opened as a print preview
Can someone help me?
thanks
disable row editing if a field is equal to....
-
- Veteran Member
- Posts: 61
- Joined: 2017-03-12 09:24
Re: disable row editing if a field is equal to....
Hi,
you can try this:
$j('td.TABLE-FIELD :contains({VALUE})').parent().find('a').each(function () { $j(this).removeAttr("onclick").removeAttr("href") } )
Where you replace TABLE, FIELD and VALUE according to your needs
you can try this:
$j('td.TABLE-FIELD :contains({VALUE})').parent().find('a').each(function () { $j(this).removeAttr("onclick").removeAttr("href") } )
Where you replace TABLE, FIELD and VALUE according to your needs
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
-
- Veteran Member
- Posts: 61
- Joined: 2017-03-12 09:24
Re: disable row editing if a field is equal to....
Hi pböttcher,
First of all, thank you for your time
Does not work
the table is "Richieste" and the field is "stato_rich"
I created the "Richieste-tv.js" file in the hooks folder
and I entered:
the second $j() it works
First of all, thank you for your time
Does not work
the table is "Richieste" and the field is "stato_rich"
I created the "Richieste-tv.js" file in the hooks folder
and I entered:
Code: Select all
$j(function() {
$j("td.Richieste-stato_rich :contains('In Attesa')").parent().find("a").each(function () { $j(this).removeAttr("onclick").removeAttr("href") } );
$j( "td.Richieste-stato_rich:contains('In Attesa')" ).css( "text-decoration", "underline" );
});
-
- Veteran Member
- Posts: 61
- Joined: 2017-03-12 09:24
Re: disable row editing if a field is equal to....
I'm sorry
was the space between stato_rich and colon
now works
thanks again
was the space between stato_rich and colon
now works
thanks again
Re: disable row editing if a field is equal to....
I have a question to this :
Should also not something be done in the detail-view?
I guess that mouse (left) click is disabled if record contains a certain value. But what if user right-click and then "pick" the link-address/URL, and opens this in a new tab - will the user then not see the detail view?
Should also not something be done in the detail-view?
I guess that mouse (left) click is disabled if record contains a certain value. But what if user right-click and then "pick" the link-address/URL, and opens this in a new tab - will the user then not see the detail view?
-
- Veteran Member
- Posts: 61
- Joined: 2017-03-12 09:24
Re: disable row editing if a field is equal to....
nothing is happening
disabling "href"
the links of the whole row become normal text
disabling "href"
the links of the whole row become normal text
-
- Veteran Member
- Posts: 61
- Joined: 2017-03-12 09:24
Re: disable row editing if a field is equal to....
only by manually changing the ID
in " ....table_view.php?SelectedID= "
With the ID of the disabled row you can open the details page....
but this could only be done by a very skilled user ...
this is not the case for my users ..
in " ....table_view.php?SelectedID= "
With the ID of the disabled row you can open the details page....
but this could only be done by a very skilled user ...
this is not the case for my users ..
Re: disable row editing if a field is equal to....
Hi,
yes of course, but this was not part of the question
If you want to disable the DV for a particular setting, you can do this as well via the hooks
yes of course, but this was not part of the question
If you want to disable the DV for a particular setting, you can do this as well via the hooks
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.