renderCell and setting column display width (in list view)

149 views
Skip to first unread message

Edward Spiegel

unread,
Apr 1, 2015, 2:31:52 PM4/1/15
to xata...@googlegroups.com
Hi,

I am trying to figure out how to get my list view looking the way that I'd like and having a few problems.

All of these are in a table named "sessions"

1) I am wanting to display my boolean fields as checkboxes and to truncate a few text fields

From what I can tell, I should be doing this by implementing a renderCell function for those columns. One column is a field whose name is "time". As a test, I added the following in my sessions.php file

class tables_sessions {
    function time_renderCell(&$record){       
        return "test";
    }
}

The normal data appears in the time column rather than the "test" reutrned byt the function.

I tried having the class listed as "tables_sessions" and "table_sessions" with the same non-result.


2) DOCUMENTATION NOTE: in the docs it shows the class format for a table as "class tables_tablename" in some places but in others it is listed as "class table_tablename". Which is correct?

3) How can you set the width that a particular column should take up in the list view?

4) How do I specify that some columns should be visible in list view but others visible in form view?

5) How do I specify where fields appear on the page in form view? I have a few short fields that I would like to appear on the same line.

6) How do I display a column in list view that pulls data from a related record?

Thanks,

Edward

Steve Hannah

unread,
Apr 1, 2015, 2:42:35 PM4/1/15
to xata...@googlegroups.com
On Wed, Apr 1, 2015 at 11:31 AM, Edward Spiegel <espie...@gmail.com> wrote:
Hi,

I am trying to figure out how to get my list view looking the way that I'd like and having a few problems.

All of these are in a table named "sessions"

1) I am wanting to display my boolean fields as checkboxes and to truncate a few text fields

From what I can tell, I should be doing this by implementing a renderCell function for those columns. One column is a field whose name is "time". As a test, I added the following in my sessions.php file

class tables_sessions {
    function time_renderCell(&$record){       
        return "test";
    }
}

The normal data appears in the time column rather than the "test" reutrned byt the function.

I tried having the class listed as "tables_sessions" and "table_sessions" with the same non-result.


It should be
time__renderCell(...)
not
time_renderCell(...)

(two underscores.
 

2) DOCUMENTATION NOTE: in the docs it shows the class format for a table as "class tables_tablename" in some places but in others it is listed as "class table_tablename". Which is correct?

tables_tablename 

3) How can you set the width that a particular column should take up in the list view?

Probably easiest to use CSS.
 

4) How do I specify that some columns should be visible in list view but others visible in form view?

visibility:list
visibility:browse
visibility:find

(hidden or visible).

For form view, you can either use widget:type=hidden, or you can use permission.


 

5) How do I specify where fields appear on the page in form view? I have a few short fields that I would like to appear on the same line.

You can specify that a field group is displayed inline using:

[fieldgroup:groupname]
display_style=inline


 

6) How do I display a column in list view that pulls data from a related record?

Use a grafted field.

Steve

Edward Spiegel

unread,
Apr 1, 2015, 3:13:02 PM4/1/15
to xata...@googlegroups.com
Thanks that was all helpful.

I asked "3) How can you set the width that a particular column should take up in the list view?"

Your answer was: "Probably easiest to use CSS."

How do I use CSS to specify the attributes of a particular column in a particular view?

I have specified a css stylesheet to use (in ApplicationDelegate.php) but don't know what class to use for a particular column in a particular type of view.

Here are two things that I want to control via css:

A column (field) called "details" in the list view of the "sessions" table.

A field called "description" in the form view of the "sessions" table.

Thanks so much,

Edward

--
You received this message because you are subscribed to the Google Groups "Xataface" group.
Visit this group at http://groups.google.com/group/xataface.
To view this discussion on the web visit https://groups.google.com/d/msgid/xataface/CABiRg%2BR9jB9LSbGi26HfTaR55LtExve8F%3Dfv8PgLex4kbRkq3g%40mail.gmail.com.

Reply all
Reply to author
Forward
0 new messages