[CLOSED] Razor Syntax for ListConfig on a combobox

  1. #1

    [CLOSED] Razor Syntax for ListConfig on a combobox

    How can I do the following in Razor syntax?

    <ListConfig  LoadingText="Searching...">
                        <ItemTpl runat="server">
                            <Html>
                                <div class="search-item">
                                     <h3><span>${Price}</span>{Common}</h3>
                                     {Botanical}
                                 </div>
                            </Html>
                        </ItemTpl>
                    </ListConfig>
    Last edited by Daniil; Mar 27, 2012 at 2:31 PM. Reason: Please use [CODE] tags, [CLOSED]
  2. #2
    Hi,

    Here you are.

    Example
    @(Html.X().ComboBox()
        .ListConfig(Html.X().BoundList()
            .LoadingText("Searching...")
            .ItemTpl(Html.X().XTemplate()
                .Html("<div class=\"search-item\"><h3><span>${Price}</span>{Common}</h3>{Botanical}</div>")
            )
        )
    )
  3. #3
    Maybe there is a way we can clean this API up a bit. Having to use a BoundList is not too obvious.

    I guess I would have expected the ListConfig properties directly off the ListConfig Builder.
    Geoffrey McGill
    Founder
  4. #4
    Yes Geoffrey - that is what I expected also... I think that would be more consistent with the other methods (especially when compared with the non-razor syntax/structure).
  5. #5
    Is it possible to do something similar to the example https://examples2.ext.net/#/Form/Com...Custom_Search/ in MVC/Razor syntax? Rather than using the .ashx file, I'm hoping that it's possible to simply use an AjaxProxy pointing to the relevant controller method but I'm not having much luck - i.e. it's never getting triggered...
  6. #6
    Quote Originally Posted by machinableed View Post
    Is it possible to do something similar to the example https://examples2.ext.net/#/Form/Com...Custom_Search/ in MVC/Razor syntax? Rather than using the .ashx file, I'm hoping that it's possible to simply use an AjaxProxy pointing to the relevant controller method but I'm not having much luck - i.e. it's never getting triggered...
    Please start a new forum with a sample to reproduce.
  7. #7
    Quote Originally Posted by machinableed View Post
    Yes Geoffrey - that is what I expected also... I think that would be more consistent with the other methods (especially when compared with the non-razor syntax/structure).
    Well, we can't see any options to improve it.

    Generally, it's the same as here:
    .ItemTpl(Html.X().XTemplate()
        .Html("<div class=\"search-item\"><h3><span>${Price}</span>{Common}</h3>{Botanical}</div>")
    )
    If you wish you could set up ListConfig this way:
    .ListConfig(new BoundList() { ... })

Similar Threads

  1. [CLOSED] Razor syntax inside Ext Controls
    By mcfromero in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Aug 08, 2012, 7:29 PM
  2. [CLOSED] DropTarget Not working in razor syntax
    By machinableed in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Apr 30, 2012, 11:08 AM
  3. [CLOSED] ImageCommand missing in Razor syntax
    By machinableed in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Apr 16, 2012, 12:05 PM
  4. Replies: 6
    Last Post: Apr 09, 2012, 3:33 PM
  5. [CLOSED] Razor syntax for adding a partial view to a Panel
    By machinableed in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Feb 23, 2012, 9:55 AM

Tags for this Thread

Posting Permissions