Page 1 of 1

Change database record link to different view mode?

PostPosted: Tue Mar 01, 2011 8:48 am
by JSours
When I click on the database record it goes to a view mode page. Instead of going into a view mode page I want it to directly go into the edit mode page. How would I do this?

Re: Change database record link to different view mode?

PostPosted: Tue Mar 01, 2011 10:39 am
by shannah
Add
Code: Select all
default_browse_action=edit


To the beginning of your conf.ini file

-Steve

Re: Change database record link to different view mode?

PostPosted: Tue Mar 01, 2011 11:05 am
by JSours
I put default_browse_action=edit in the very beginning of the conf.ini file and nothing happens. It still directs to the view page

Re: Change database record link to different view mode?

PostPosted: Tue Mar 01, 2011 11:18 am
by shannah
This should work. It has been in there since version 0.6 and I'm successfully running this directive on dozens of installs. Double check to make sure you don't have a typo in the directive.

Re: Change database record link to different view mode?

PostPosted: Tue Mar 01, 2011 11:29 am
by JSours
Okay i found out that one of the [_prefs] options was disabling this feature because when I took out all the lines under [_prefs] it worked. I just have to go line by line and find out which one.

Thank you

Re: Change database record link to different view mode?

PostPosted: Tue Mar 01, 2011 12:00 pm
by JSours
One more question, how do I hide the view tab itself?

Re: Change database record link to different view mode?

PostPosted: Tue Mar 01, 2011 12:12 pm
by shannah
Create an actions.ini file if you haven't already in the main app directory. Then override the "view" action and either set it's category to something else, change the condition to "0" of "false", or set the permission to something that your users dont have access to.

An example of doing it by setting the category is as follows:

Code: Select all
[view > view]
    category=""

Re: Change database record link to different view mode?

PostPosted: Tue Mar 01, 2011 12:29 pm
by JSours
Thank you!

Re: Change database record link to different view mode?

PostPosted: Mon Nov 14, 2011 11:10 pm
by ctripp
Hi there, It seems I am having a similar problem to the one described in the previous post.
Using default_browse_action=edit in the config.ini does not seem to have any effect.
However I do not have any [_prefs] in the config.ini

Code: Select all
;;Configuration settings for application
title="appletra_applestores"
default_browse_action=edit
hide_search=1
debug=0

[_database]
   host="localhost"
   name="appletra_applestores"
   user="appletra_atkuser"
   password="*******************"
   
[_tables]
STORE = "Store"
STOREDESIGN = "Design"
PROJECT = "Project"
EQUIPMENT = "Equipment"
NOTE = "Notes / History"
;SPKMETHOD = "Speaker Method"
;DESIGNTYPE = "Design Type"
;STATE = "State"
;COUNTRY = "Country"
;TYPE = "Type"
;LOCATION = "Location"
;PRODUCT = "Product"
;CATEGORY = "Category"


Also, I am not sure if this is related but in the tables actions.ini file, if I use
Code: Select all
[view > view]
    condition="false"

then it seems to remove BOTH the view and edit tabs.

Clayton

Re: Change database record link to different view mode?

PostPosted: Wed Jan 18, 2012 5:50 am
by Tadas
Hi, I have a question on relative matter.

In list view, when selecting a record, instead of default 'detail' view, is it possible to make an URL to that particular entry but in a different table.

In my case:
I have a table 'defektai' where the fields are populated from other tables, such as 'asmuo' (people) .
If i select a row with a particular persons name (under a column "Atsakingas asmuo"(responsible person)) and I press on the name, I need that it would go to another table and open that particular name details.
It would be perfect to set up such thing in this table, for a couple of columns.

I attach a screenshot (if its of any help):
http ://dl.dropbox.com/u/13952207/ss_xataface.png

Thanks!

Tadas

Re: Change database record link to different view mode?

PostPosted: Mon Jan 23, 2012 12:06 pm
by shannah
You can always build a URL to go exactly where you want to go using Xataface URL conventions. E.g.
index.php?-table=people1&person_id=10
index.php?-table=people2&person_id=10

One would go to the record from table people1 where person_id is 10 and the other goes to table people2 where person_id is 10.

There are also convenience functions for generating URLs for you.
e.g.
Dataface_Application::url()
and
Dataface_Record::getURL()
e.g.

Code: Select all
$app = Dataface_Application::getInstance();
$url = $app->url('-table=people&person_id=10');
or
$url = $app->url(array('-table'=>'people', 'person_id'=>10));


-Steve