Inline select list or radio button

Inline select list or radio button

koniahinkoniahin Posts: 186Questions: 39Answers: 7

Looking through all the examples I see that you can set up select lists, radio buttons, and similar that can be accessed when you click on the "Edit" button and open the update options in a pop-up box. However in none of the examples do I see an option to display a select list inline, say a list of countries, in a cell. The advantage here is that it's less clicks for the administrator. Rather than having to:

Select a row
Click the "Edit" button
Select the country from the list in the popup
Click "Update"

You simply select the country.

Is this doable, how?

Answers

  • allanallan Posts: 63,455Questions: 1Answers: 10,465 Site admin

    The last column in this example makes use of select inline.

    In theory any input type that can be used in the main form can also be used inline. I say "in theory" as not all input types are suitable for inline editing - e.g. a wysiwyg editor wouldn't be a particular great interface for inline editing, even although it would work!

    Allan

  • koniahinkoniahin Posts: 186Questions: 39Answers: 7
    edited July 2018

    Quite surprisingly I got an inline select list from a query working.

    { data: "articles.alias", editField: "menu_items.url_id" }
    

    In the php file I added the Field with a leftJoin as in the example. Now for the simple.
    I've been looking around for a simple toggle example something like Publish with 2 options, Yes/No.

    What is the syntax for setting up a simple toggle of several static items like yes/no or 1-4? It will match the same Publish (or other) options I set up in the Editor.

  • allanallan Posts: 63,455Questions: 1Answers: 10,465 Site admin

    Sounds like radio is what you want there - or perhaps checkbox?

    Allan

  • koniahinkoniahin Posts: 186Questions: 39Answers: 7

    Yes checkbox but I need to see an example of the syntax.

  • koniahinkoniahin Posts: 186Questions: 39Answers: 7

    Checkbox - sorry probably not checkbox. It would be the syntax for a simple dropdown select with 2 options, Yes and No.

  • allanallan Posts: 63,455Questions: 1Answers: 10,465 Site admin

    For a dropdown with yes / no options, have a look at this example (Done/Todo in the example, but the principle applies).

    Allan

  • koniahinkoniahin Posts: 186Questions: 39Answers: 7

    Perhaps you misunderstand. The example that you referenced only helps in display, it does not give the ability to make a choice, inline.

  • kthorngrenkthorngren Posts: 21,300Questions: 26Answers: 4,945
    edited July 2018

    I've used radio buttons inline:

    I suspect the examples that Allan has shown will work inline as well. Are you having problems getting radio buttons or whatever type of list you want working with inline editing?

    Kevin

  • koniahinkoniahin Posts: 186Questions: 39Answers: 7

    Yes I'm not javascrpt-skilled, need to see a sample of the code to make it happen.

    Here's what I have that works in the popup editor:

      }, {
        label: 'Publish:',
        name: 'menu_items2.publish',
        type: "select",
        options: [
          { label: "Yes", value: "yes" },
          { label: "No", value: "No" }
        ]
      }, {
    
  • kthorngrenkthorngren Posts: 21,300Questions: 26Answers: 4,945
    edited July 2018

    Does it not work with inline editing?

    If not what happens?

    Do you get any errors?

    Kevin

  • allanallan Posts: 63,455Questions: 1Answers: 10,465 Site admin

    That should work just fine with inline editing. All of the built in field controls will work for main, bubble and inline editing. Just trigger inline editing on your cells in that column like you do for any other inline edit.

    Allan

This discussion has been closed.