More complex relationship between table

A place for users and developers of the Xataface to discuss and receive support.

More complex relationship between table

Postby fantomasdm » Wed Sep 02, 2009 9:23 am

Is possible to create something like this:http://www.evolutility.org/demo/demo_winecellar.aspx
with xataface? With some field from primary table, and all of secondary table?
fantomasdm
 
Posts: 114
Joined: Thu Mar 13, 2008 2:35 pm

Postby shannah » Wed Sep 02, 2009 12:48 pm

They have a very nice interface. This application looks very similar to what you would get out of a xataface application.

In fact, that particular application with Xataface could probably be written in an hour or two.
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby fantomasdm » Thu Sep 03, 2009 7:54 am

Is possible to see more than title of primary record ?
At this moment i have add

Code: Select all
function getTitle(&$record)
   {
      return $record->val('nome').' '.$record->val('cognome');
   }


to class of primary table to see 2 fields (nome[name] and cognome[family name]) when view recods in browse mode (in current record) , how can I change
layout for this?

Sorry for my ItalianEnglish......
fantomasdm
 
Posts: 114
Joined: Thu Mar 13, 2008 2:35 pm

Postby shannah » Thu Sep 03, 2009 8:44 am

You might try to fill the before_record_tabs slot with the content that you want.

e.g.
Code: Select all
function block__before_record_tabs(){
    $record =& Dataface_Application::getInstance()->getRecord();
   
    echo "Name: ".$record->htmlValue('name');  // etc....
}


This will appear just before the record tabs (e.g. View, Edit, etc..)

-Steve
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby fantomasdm » Fri Sep 04, 2009 12:41 am

hi! I have add this code, now if in fields.ini add attribute viewInPrimary=true
I can see it!! Thanks!!



Code: Select all
        function block__before_record_tabs()
        {
            $record =& Dataface_Application::getInstance()->getRecord();
            $table = & Dataface_Table::loadTable("anagrafica");
            $fields =& $table->fields(false,true);
            $fieldnames = array_keys($fields );
            foreach ($fieldnames as $field)
            {
                if(  @$fields[$field]['viewInPrimary'])
                    echo @$fields[$field]['widget']['label'].":".$record->htmlValue(   $field )."<br>\n";
            }
        }
fantomasdm
 
Posts: 114
Joined: Thu Mar 13, 2008 2:35 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 22 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved