jQWidgets Forums
jQuery UI Widgets › Forums › Grid › grid empty new row dropdownlist default selected
This topic contains 1 reply, has 2 voices, and was last updated by Dimitar 10 years, 5 months ago.
Viewing 2 posts - 1 through 2 (of 2 total)
-
Author
-
hello
How can the default DropDownList selected$("#GridInvoiceVsInvoiceItems").jqxGrid( { width: '72.3%', source: gridAdapter, editable: true, height: '300px', altrows: true, showaggregates: true, showstatusbar: true, showtoolbar: true, selectionmode: 'singlerow', // editmode: 'selectedrow', statusbarheight: 50, rendertoolbar: toolbarfunc, ready: function () { }, columns: [ { text: 'Name', columntype: 'dropdownlist', datafield: 'Name', width: 177, initeditor: function (row, cellvalue, editor) { editor.jqxDropDownList({promptText: "Select Item", displayMember: 'Name', source: itemAdapter }); } },
var toolbarfunc = function (toolbars) { var theme = ""; var toTheme = function (className) { if (theme == "") return className; return className + " " + className + "-" + theme; } var container = $("<div style='overflow: hidden; position: relative; height: 100%; width: 100%;'></div>"); var buttonTemplate = "<div style='float: left; pining: 3px; margin: 2px;'><div style='margin: 4px; width: 16px; height: 16px;'></div></div>"; var addButton = $(buttonTemplate); var deleteButton = $(buttonTemplate); container.append(addButton); container.append(deleteButton); toolbars.append(container); addButton.jqxButton({ cursor: "pointer", enableDefault: false, disabled: true, height: 25, width: 25 }); addButton.find('div:first').addClass(toTheme('jqx-icon-plus')); addButton.jqxTooltip({ position: 'bottom', content: "Add" }); deleteButton.jqxButton({ cursor: "pointer", disabled: true, enableDefault: false, height: 25, width: 25 }); deleteButton.find('div:first').addClass(toTheme('jqx-icon-delete')); deleteButton.jqxTooltip({ position: 'bottom', content: "Delete" }); // TOOLBAR ICON addButton.jqxButton({ disabled: false }); deleteButton.jqxButton({ disabled: true }); addButton.click(function (event) { if (!addButton.jqxButton('disabled')) { $("#GridInvoiceVsInvoiceItems").jqxGrid('addRow', 0, {}, 'first'); addButton.jqxButton({ disabled: true }); deleteButton.jqxButton({ disabled: true }); var rows = $('#GridInvoiceVsInvoiceItems').jqxGrid('getboundrows'); } }); });
and
I am loading data. but does not data appear ( only droplists)
Hello mustafa,
To have a default selected value, you would have to set it when the row is added, i.e.:
addButton.click(function(event) { if (!addButton.jqxButton('disabled')) { $("#GridInvoiceVsInvoiceItems").jqxGrid('addRow', 0, { Name: 'asdsa' }, 'first'); addButton.jqxButton({ disabled: true }); deleteButton.jqxButton({ disabled: true }); var rows = $('#GridInvoiceVsInvoiceItems').jqxGrid('getboundrows'); } });
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/ -
AuthorPosts
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic.