jQWidgets Forums
jQuery UI Widgets › Forums › Editors › Button, RepeatButton, ToggleButton, LinkButton › DropDownButton
Tagged: drop down button
This topic contains 4 replies, has 2 voices, and was last updated by simcon94 11 years, 9 months ago.
-
AuthorDropDownButton Posts
-
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…..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 StoevjQWidgets Team
http://www.jqwidgets.com/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….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…..
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….
-
AuthorPosts
You must be logged in to reply to this topic.