jQWidgets Forums
Forum Replies Created
-
Author
-
June 25, 2018 at 10:42 pm in reply to: Grid button icon not scrolling up in grid Grid button icon not scrolling up in grid #100722
Notice the images don’t remain associated with the row. I have to figure out how to use this initwidget callback.
https://www.jqwidgets.com/angular/angular-grid/angular-grid-widgetcolumn.htm
June 25, 2018 at 8:52 pm in reply to: Grid button icon not scrolling up in grid Grid button icon not scrolling up in grid #100720Thanks Martin,
I’m looking at one of the demo examples and it appears I’m missing some code in the initwidget function. The code below is from the demo, and I basically have nothing in my initwidget function. When I comment this portion out in the demo, the same behavior is replicated. I’m a newbie, so I’ll have to figure out how to modify this code to fit my grid.
initwidget: function (row, column, value, htmlElement) { var imgurl = 'images/' + value.toLowerCase() + '.png'; $(htmlElement).find('.buttonValue')[0].innerHTML = value; $(htmlElement).find('img')[0].src = imgurl; }
Demo URL: https://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/customwidgetscolumn.htm?light
June 12, 2017 at 3:24 pm in reply to: Grid with columnype jqxDropDownList Grid with columnype jqxDropDownList #94276Very helpful, thank you!
October 4, 2016 at 3:26 pm in reply to: Grid addrow function almost works Grid addrow function almost works #87901Yeah..that worked. Thanks for helping out a rookie. You rock.
October 3, 2016 at 3:06 pm in reply to: Grid addrow function almost works Grid addrow function almost works #87873Here’s my addrow code copied from my source.
addrow: function (rowid, rowdata, position, commit) {
var computerData = $(‘#newComputer’).serialize();//grab all form fields
$.ajax({
url: ‘getDetails.cfc?method=’addComputer’&’ + computerData,
type:”POST”,
async: false,
success: function(response){
commit(true);
alert(rowdata);},
error : function(jqXHR, textStatus, errorThrown){
alert(errorThrown);
alert(‘damn’);
commit(false);
}
});October 3, 2016 at 3:00 pm in reply to: Grid addrow function almost works Grid addrow function almost works #87872Thanks Hristo.
I’m trying to write something that resembles an existing sample, shown below
// create new row.
$(“#addrowbutton”).on(‘click’, function () {
var datarow = generaterow();
var commit = $(“#jqxgrid”).jqxGrid(‘addrow’, null, datarow);
});Seems straight forward. My version creates the proper key value format,
var rowData = JSON.stringify(myform.serializeObject());Here’s what rowData produces if I console.log or alert() the output.
{“computerId”:””,”TemplateId”:”68″,”Make”:”Lenovo”,”Model”:”X200″,”Processor”:”Intel Core 2 Duo P8700 (2.53GHz)”,”Memory”:”2048″,”MemConfig”:”1x2GB;1x2GB”,”Drive”:”240GB SSD”,”Rom”:”DVD-ROM/CD-RW Multi”,”Acquired”:”02-01-2010″,”DeviceType”:””,”LSBC”:”qqqqqqqqq”,”Serial”:””,”ProductNumber”:””,”Mac”:””,”AlternateName”:””,”isRetired”:”false”}
If I just paste this info into a variable it works fine i.e.
rowData = {“computerId”:””,”TemplateId”:”68″,”Make”:”Lenovo”,”Model”:”X200″,”Processor”:”Intel Core 2 Duo P8700 (2.53GHz)”,”Memory”:”2048″,”MemConfig”:”1x2GB;1x2GB”,”Drive”:”240GB SSD”,”Rom”:”DVD-ROM/CD-RW Multi”,”Acquired”:”02-01-2010″,”DeviceType”:””,”LSBC”:”qqqqqqqqq”,”Serial”:””,”ProductNumber”:””,”Mac”:””,”AlternateName”:””,”isRetired”:”false”}
But the code below doesn’t work. The grid adds an empty row, like rowData is empty {}. Is there a chance the first line is taking too long to populate rowData and the second line runs with an empty variable? I’m a total noob, so I appreciate the help. Thanks.
var rowData = JSON.stringify(myform.serializeObject());
var commit = $(“#hardware_grid”).jqxGrid(‘addrow’, null, rowData)
Great Thanks.
var cellclass = function (row, columnfield, value, record) {
var credit = record.credit;
if(credit == 0){
return ‘red’;
}}
<style>
.red:not(.jqx-grid-cell-hover):not(.jqx-grid-cell-selected), .jqx-widget .red:not(.jqx-grid-cell-hover):not(.jqx-grid-cell-selected) {
color: black;
background-color: #f8d5d5;
}
</style>September 16, 2015 at 10:30 pm in reply to: Refreshing Source for jqxDropDownList Refreshing Source for jqxDropDownList #75921Just to follow up, I modified the renderer property in the same function and it seems to do what I want. I’m sure there is a more eloquent way to accomplish this, but this will suffice. Thanks for all your help.
W
function refreshData(employee_id){
var newSource = myData(employee_id);
$(“#employee_id”).jqxDropDownList(
{
source: newSource,
renderer: function (index, label, value) {
var datarecord = newSource.records[index];
var imgurl = ‘http://lex.lsbc.org/extract/staff/’ + datarecord.staff_pic;
var img = ‘‘;
var table = ‘<div style=”float:left; width:90px;”>’ + img + ‘</div> <div>’ + datarecord.preferred_nm + ‘</div></br><div>’ + datarecord.title + ‘</div>’
return table;} });
September 16, 2015 at 6:50 pm in reply to: Refreshing Source for jqxDropDownList Refreshing Source for jqxDropDownList #75920Hi Peter,
Thanks so much. This worked!
“set the DropDownList’s source property to point to the new instance.”
function refreshData(employee_id){
var newSource = myData(employee_id);
$(“#employee_id”).jqxDropDownList({ source: newSource });
}I click a button, create a new instance, then point the source property to this new instance. However, this drop down includes a table, so if I update the source of the dropDownList I need to change the source in the renderer portion of the drop down. This seems like an easy thing to accomplish but I’m clueless. Do you know of an easy way to do this?
As always, thanks for any help.
W
$(“#employee_id”).jqxDropDownList(
{
source: employees,
theme: poptheme,
selectedIndex: 0,
displayMember: ‘preferred_nm’,//label
valueMember: ‘employee_id’,//value
itemHeight: 80,
width: ’425′, height: ’25′,renderer: function (index, label, value) {
//Need the code below to change to var datarecord = newSource.records[index]; when source is changed.
var datarecord = employees.records[index];var imgurl = ‘http://site.abc.org/extract/staff/’ + datarecord.staff_pic;
var img = ‘‘;
var table = ‘<div style=”float:left; width:90px;”>’ + img + ‘</div> <div>’ + datarecord.preferred_nm + ‘</div></br><div>’ + datarecord.title + ‘</div>’
return table;}
});September 15, 2015 at 3:32 pm in reply to: Refreshing Source for jqxDropDownList Refreshing Source for jqxDropDownList #75868Thanks so much Peter. I hope I’m understanding correctly, but I am setting a dropdown list source property and it does populate correctly when the page first runs. refreshData() is called on a click event . Presumably, “var employees = myData(1);” should be recreating the dataAdapter instance “employees”, and “employees.dataBind()” would refresh the dropdown list. Since it doesn’t work, I must be missing something. Any assistance would be appreciated.
Thanks
W
$(“#employee_id”).jqxDropDownList(
{
source: employees,
theme: poptheme,
selectedIndex: 0,
displayMember: ‘preferred_nm’,//label
valueMember: ’employee_id’,//value
itemHeight: 80,
width: ‘425’, height: ’25’,renderer: function (index, label, value) {
var datarecord = employees.records[index];var imgurl = ‘http://site.abc.org/extract/staff/’ + datarecord.staff_pic;
var img = ‘‘;
var table = ‘<div style=”float:left; width:90px;”>’ + img + ‘</div> <div>’ + datarecord.preferred_nm + ‘</div></br><div>’ + datarecord.title + ‘</div>’
return table;}
});August 6, 2015 at 4:22 pm in reply to: Month and Year not updating Month and Year not updating #74586I just downloaded jQWidgets v3.8.2 (2015-Aug) and the calendar picker issue is resolved. I’m happy.
Cheers
B
August 6, 2015 at 3:54 pm in reply to: Month and Year not updating Month and Year not updating #74585Hi Peter,
Thanks for the reply. I’m able to navigate with the arrows to move to a different year and select a month, but I find the popup closes immediately afterwards and doesn’t update the text box. In the site demo, the popup stays open to allow the user to select a day, at which point the popup closes and the date is fully updated in the textbox. Not sure what I’m doing wrong.
B
-
AuthorPosts