jQWidgets Forums
Forum Replies Created
-
Author
-
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….
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…..
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….I implemnted on this way..
var source =
{
datatype: “json”
,async: false
,datafields: [
{ name: ‘Id’ }
, { name: ‘ParentId’ }
, { name: ‘Name’ }
]
, id: ‘Id’
, icon: sk.appHelper.getAppDomainAppVirtualPath() + ‘/Content/icons/factory.png’
, url: sk.appHelper.getAppDomainAppVirtualPath() + “/Topology/GetTopologyTree”
};But its still not showing the icon.
And i have one more question.
Is it possible, to set the source into jqxDropDownButton?
Do you have an example?Ok. Thanks.
And how can i add icons to Tree with Json?I have the same problem like:
http://www.jqwidgets.com/community/topic/getting-the-selected-item-from-the-original-source-constructor-argument/New Problem.
When i click in the Tree, how will i get the Id of the Node?Ok. I found the error.
We have one css file, the overrides the ul tag…..OMG…..Thanks for your support.
Sorry, but it is still not displying like in your demo.
Could it be about the theme or css File?I copied your demo code into my html file. But i didn`t have an hierachical tree
Thats the same effect.
I want have the effect, like in your demo:
http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxtree/index.htm#demos/jqxtree/treebindingtojson.htmMy Tress should be display like the FRAPPUCINO entry.
Test and Test1 not on the same level.
Thanks. It works….
August 6, 2013 at 11:57 am in reply to: Delete last Row in Grid Error Delete last Row in Grid Error #26331After the commit(true) in deleteRow, i call the referesh Methode of grid. This Works….
ThanksAugust 6, 2013 at 11:39 am in reply to: Delete last Row in Grid Error Delete last Row in Grid Error #26327OK. Thanks.
When i want to delete the Row and the entry in Database, the Grid will be standing “still”.
Nothing happens after the commit(true) in deleteRow.
Thats only at deleting the last row also….Did you have an alternative?
August 6, 2013 at 9:56 am in reply to: Delete last Row in Grid Error Delete last Row in Grid Error #26315Im my Grid i have this column:
text: ”, datafield: ‘Delete’, width: 50, columntype: ‘number’, cellsrenderer: function () {
return ‘‘;
}in my cell click event:
if (columnindex == columnDelete) {
editrow = rowindex;
if (editrow >= 0) {
var rowscount = $(“#grid”).jqxGrid(‘getdatainformation’).rowscount;
if (editrow >= 0 && editrow < rowscount) {
var rowId = $('#grid').jqxGrid('getrowid', editrow);var roleId = $('#grid').jqxGrid('getcellvalue', rowId, "Id");
var test = deleteRow(roleId, "/Role/DeleteRole");
if (test === true) {
var commit = $('#grid').jqxGrid('deleterow', rowId);
}
}
}This Function is an Ajax call:
deleteRow(roleId, "/Role/DeleteRole")
when this Function is success, then deleteRow in Grid:
$('#grid').jqxGrid('deleterow', rowId);I hope thie helps
-
AuthorPosts