Editable List View?

105 views
Skip to first unread message

Edward Spiegel

unread,
Nov 13, 2016, 1:34:17 PM11/13/16
to xata...@googlegroups.com
Is there a way to make records editable in List View? I have a couple of applications where it would be enormously handy to be able to edit fields in the list tab.

Thanks,

Edward

hp.ros...@gmail.com

unread,
Nov 14, 2016, 10:24:41 AM11/14/16
to Xataface
hi Edward,

You can use either:

The Ajax form module

The Datagrid module (not compatible with msqli first, but can be easily upgraded)

MySQLforExcel is also doing the job

Hope it answer your question

Pierrick

 

Ti Tou

unread,
Nov 14, 2016, 12:41:28 PM11/14/16
to Xataface
Hi Edward,

Have you seen this :

http://xataface-tips.blogspot.fr/2014/04/editable-select-widget-in-list-view.html

I have already used it.

-
Ti

Edward Spiegel

unread,
Nov 14, 2016, 3:09:45 PM11/14/16
to xata...@googlegroups.com
Thanks for the responses. I will check them out.

Best,

Edward

--
You received this message because you are subscribed to the Google Groups "Xataface" group.
Visit this group at https://groups.google.com/group/xataface.
To view this discussion on the web visit https://groups.google.com/d/msgid/xataface/79dbeaa0-5f77-4eb2-b34f-354c20fb0df7%40googlegroups.com.

Edward Spiegel

unread,
Nov 15, 2016, 7:27:06 PM11/15/16
to xata...@googlegroups.com
So, I have implemented some editable fields with selects using the method from:

http://xataface-tips.blogspot.fr/2014/04/editable-select-widget-in-list-view.html

I am using hard-coded selects as I haven't been able to figure out how to get the delegate class to make use of the vocabulary that I defined in valuelists.ini. I hunted around on the wiki and in the google group but couldn't figure out how to fill the $options array from the valuelist that I defined.

Related: how do you get the Select list to be filled from the ENUM types?

Thanks,

Edward

Edward Spiegel

unread,
Nov 17, 2016, 7:02:20 PM11/17/16
to Xataface
Hello,

Any suggestions about:

* How to access a voluelist/vocabulary from a delegate class (via php) so that I can populate a select (for an editable list table field) in my delegate class

I followed the tutorial: http://xataface-tips.blogspot.fr/2014/04/editable-select-widget-in-list-view.html

But it doesn't mention how to retrieve a vocabulary/valuelist.

Is there an example available somewhere that shows the best way to do this

Thanks,

Edward

Ti Tou

unread,
Nov 20, 2016, 4:07:55 PM11/20/16
to Xataface
Hi,

1.
I don't know how works the function xxx__getAddableValues(Dataface_Record $record){}
With xxx is a name field followed by two underscores.

I think it's a good start to check documentation or the code-source
 ./Dataface/DelegateClass.php

2.
For my part, I use function valuelist__xxx
With xxx is a valuelist name declared in valuelists.ini (don't forget, there is two underscores).

  function valuelist__xxx(){
      $query = Dataface_Application::getInstance()->getQuery();
      // you can mix both vocabulary defined in valuelists.ini and an other valuelist for only records edited on relationship
      // if you want to change the value only when the user edited related records on relationship relABC
      if ( array_key_exists('-relationship', $query) && $query['-relationship'] == 'relABC' ){
        $app =& Dataface_Application::getInstance();
        $currentrecord =& $app->getRecord();
        if (! isset($currentrecord)) { return null; }

        // you can add filter
       // for example, you want all the values of the columnV (v as values) from the table tableXYZ only where a column columnC (c as condition) have the exact value valueEV (ev as exact value)
        $newlist = df_get_records_array('tableXYZ', array('columnC'=>'=valueEV'')); // note the "=" after "=>"
        $out = array();
        foreach ( $newlist as $li){
            $out[$li->val('id')] = $li->val('columnV'); // note : in the fields.ini : [columnV] widget:type = select
        }

        return $out;
      }
  }


Try the simpliest (without filter, without check relationship) and adapt gradually.

-
Ti

Edward Spiegel

unread,
Nov 22, 2016, 2:01:10 PM11/22/16
to xata...@googlegroups.com
Answering my own question in case it helps someone else in the future.

After digging through the various docs and the Xataface source code, I found a way that works.

If you have a reference to a database record ($record) and want to get a vocabulary named "mylistname", the following will work

$options = $record->_table->getValuelist("mylistname");

You can also grab a field's valuelist without knowing the vocabulary name with this code:

$options =& $table->getValuelist($field['vocabulary']);


Best,

Edward

--
You received this message because you are subscribed to the Google Groups "Xataface" group.
Visit this group at https://groups.google.com/group/xataface.
Reply all
Reply to author
Forward
0 new messages