jQWidgets Forums

jQuery UI Widgets Forums Grid Simpler Drop Down List implementation ?

This topic contains 2 replies, has 2 voices, and was last updated by  Marc 10 years, 11 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author

  • Marc
    Participant

    Hi,

    [Context info]
    I’ve implemented the following code in an application.

    In order to understand what I was doing, as already mentioned in another post, I first drew this chart. Since it helped me sorting things out, I’m including it here.

    The chart shows that the displayfield/datafield pair is referenced at several places :

    • In the grid’s source (gridSource & gridAdapter) – see lower part of the chart.
    • In the grid : #jqxGrid on top of the chart.
    • In the drop down list source on the right part of the chart (countriesSource & countriesAdapter).

    As shown by the arrows, each field declaration reference each other.

    [Usual drop down list implementations]
    Outside jqWidget, implementing a drop down list, in a grid or other data oriented controls, is an usual pattern. Very often, the pattern is simpler:

    • The grid’s source does not know of the display field: it just stores the data field.
    • The grid just know it has a dropdown list, and that its datafield is bound to field X of the dropdown list’s source.
    • The drop down list displays field Y, and passes the corresponding field X’s value to the grid.

    Such an implementation would simplify the chart as follows:

    • In gridSource:
      • No more values (& source/value/name) reference.
      • No more country field; its value declaration would be transferred to datafield declaration, in order to reference datafield in the grid’s source.
    • In #jqxGrid: no more displayfield declaration.

    [Questions]
    Do you know if such a simpler implementation of the dropdown list in grids is possible?
    If not, does that make sense, and could it be a suggestion for further versions? The benefit would be majoritarily easier code to write and maintain.

    Otherwise, obviously, it works as it is, and even if it is always possible to improve things, that’ already quite well.

    Thanks and regards.

    Marc.


    Peter Stoev
    Keymaster

    Hi Marc,

    That is the Custom DropDownList implementation which we can suggest you. By default, using DropDownList with Display/Value members is a Custom Implementation which overrides the default Editor. We do not plan any changes in that direction in the future. In fact, introducing such changes would be a breaking change and we do not want that. Probably everything could be better, but that is what we have for now.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com


    Marc
    Participant

    Hi Peter,

    Thank you for this answer.

    No problems. jqWidget is very powerful as it is, and has some very elegant and efficient design. This is the reason why I choosed it over other products aiming at similar goals.

    As a jqWidget user, my contribution is to suggest enhancements when I see opportunities. What I can’t see is the level of impact it’d have on the current design. So “good idea but we can’t do it because impacts would be too big” is perfectly acceptable.

    As far as I’m concerned, now I wrote some grids that works, with crud capabilities, dropdown lists, master-detail, etc., I’m starting to write a function that encapsulate the repetitive code, with a set of input parameters, in such a way that any grid in the app will be a mere call to this function, preceeded by input parms setup. This will replace for each grid a couple of pages of code by a few lines.

    So that will take care of the dropdown list code – relative – complexity anyway.

    Best regards.

    Marc.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.