jQWidgets Forums

This topic contains 4 replies, has 2 voices, and was last updated by  simcon94 11 years, 9 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • DropDownButton #28191

    simcon94
    Participant

    Hi,
    is it possible, to set the dropDownButton with label and Id?
    Because to store the data in the DB i need the Id of the Label…..

    DropDownButton #28192

    Peter Stoev
    Keymaster

    Hi simcon94,

    The DropDownButton’s Content displays HTML or Text. In your logic, you can store label and id associated the the button’s content, but the content is HTML or Text.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

    DropDownButton #28196

    simcon94
    Participant

    Ok.
    I implemted an workaround. That works.
    Is it possible to have an empty string before the tree in dropdownButton is set?
    Because the user have the chance to select nothing….

    DropDownButton #28197

    simcon94
    Participant

    Thats strange.
    Thats my Source:

    var source =
    {
    datatype: “json”
    ,async: false
    ,datafields: [
    { name: ‘Id’ }
    , { name: ‘ParentId’ }
    , { name: ‘Name’ }
    ]
    , id: ‘Id’
    , url: sk.appHelper.getAppDomainAppVirtualPath() + “/Test/GetTest”
    };
    // create data adapter.
    var dataAdapter = new $.jqx.dataAdapter(source);
    dataAdapter.dataBind();
    var records = dataAdapter.getRecordsHierarchy(‘Id’, ‘ParentId’, ‘items’, [{ name: ‘Name’, map: ‘label’ }, { name: ‘Id’, map: ‘id’ }]);

    In the Controller:
    public JsonResult GetTest()
    {
    var List = MvcApplication.BusinessLogicContext.LogicContext.TopologyLogic.GetAll().List();
    var gridList = new List();

    foreach (var topology in List )
    {
    var top = new UserGridModel.TopologyGrid
    {
    Id = topology.Id
    ,Name = topology.Name
    };
    if (topology.ParentTopology != null)
    {
    top.ParentId = topology.ParentTopology.Id;
    }

    gridList.Add(top);
    }

    return Json(gridList, JsonRequestBehavior.AllowGet);
    }

    When i Insert this Line:
    gridList.Insert(0, new UserGridModel.TopologyGrid { Name = “Test”, Id = new Guid(), ParentId = new Guid() });

    befor i return the function, the records in
    var records = dataAdapter.getRecordsHierarchy(‘Id’, ‘ParentId’, ‘items’, [{ name: ‘Name’, map: ‘label’ }, { name: ‘Id’, map: ‘id’ }]);
    is empty.

    When i didn’t insert the line, the record is OK….

    So strange…..

    DropDownButton #28200

    simcon94
    Participant

    The problem is:
    Id = new Guid()

    When i insert Id = new Guid(“00000000-0000-0000-0000-000000000001”)
    the it works.
    But this isn’t the correct way….It also have to work, when i insert
    Id = new Guid(“00000000-0000-0000-0000-000000000000”)…

    hmmmm….

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

You must be logged in to reply to this topic.