jQWidgets Forums

Forum Replies Created

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • in reply to: setcolumnproperty not working setcolumnproperty not working #23265

    maurizio
    Participant

    How silly of me…. It works now with the correct case
    Thanks
    Maurizio

    in reply to: setcolumnproperty not working setcolumnproperty not working #23253

    maurizio
    Participant

    please see original post


    maurizio
    Participant

    yes, it works in version 2.8.1 but that version breaks the rest of my application. Any chance we could find a fix for version 2.7?


    maurizio
    Participant

    I have added a toolbar to a grid, which shows a “filter” button when the grid data is filtered. Clicking on the filter button calls the clearfilters function and the grid show the unfiltered data. This works fine, but when I use rowdetails the clearfilters function does not work anymore and the browser throws an “Uncaught TypeError: Cannot read property ‘id’ of undefined”, which seems to be generated by the v.handle code in the
    jquery-1.9.1.min.js.

    The code below, adapted from the grid rowdetails demo, demonstrates the issue. If I comment the following lines:

    rowdetails: true,
    rowdetailstemplate: { rowdetails:….. },
    initrowdetails: initrowdetails,

    it all works fine, but if I uncomment them I get the error.

    <!DOCTYPE html>
    <html lang="en">
    <head>
    <title id='Description'>This example shows how to display row details after each grid row.</title>
    <link rel="stylesheet" href="../jqwidgets/jqwidgets/styles/jqx.base.css" type="text/css" />
    <link rel="stylesheet" href="../jqwidgets/jqwidgets/styles/jqx.ui-redmond.css" type="text/css" />
    <script type="text/javascript" src="../jqwidgets/scripts/jquery-1.9.1.min.js"></script>
    <script type="text/javascript" src="../jqwidgets/jqwidgets/jqx-all.js"></script>
    <script type="text/javascript">
    $(document).ready(function () {
    var theme = 'ui-redmond';
    // prepare the data
    var data = new Array();
    var firstNames = ["Nancy", "Andrew", "Janet", "Margaret", "Steven", "Michael", "Robert", "Laura", "Anne"];
    var lastNames = ["Davolio", "Fuller", "Leverling", "Peacock", "Buchanan", "Suyama", "King", "Callahan", "Dodsworth"];
    var titles = ["Sales Representative", "Vice President, Sales", "Sales Representative", "Sales Representative", "Sales Manager", "Sales Representative", "Sales Representative", "Inside Sales Coordinator", "Sales Representative"];
    var titleofcourtesy = ["Ms.", "Dr.", "Ms.", "Mrs.", "Mr.", "Mr.", "Mr.", "Ms.", "Ms."];
    var birthdate = ["08-Dec-48", "19-Feb-52", "30-Aug-63", "19-Sep-37", "04-Mar-55", "02-Jul-63", "29-May-60", "09-Jan-58", "27-Jan-66"];
    var hiredate = ["01-May-92", "14-Aug-92", "01-Apr-92", "03-May-93", "17-Oct-93", "17-Oct-93", "02-Jan-94", "05-Mar-94", "15-Nov-94"];
    var address = ["507 - 20th Ave. E. Apt. 2A", "908 W. Capital Way", "722 Moss Bay Blvd.", "4110 Old Redmond Rd.", "14 Garrett Hill", "Coventry House", "Miner Rd.", "Edgeham Hollow", "Winchester Way", "4726 - 11th Ave. N.E.", "7 Houndstooth Rd."];
    var city = ["Seattle", "Tacoma", "Kirkland", "Redmond", "London", "London", "London", "Seattle", "London"];
    var postalcode = ["98122", "98401", "98033", "98052", "SW1 8JR", "EC2 7JR", "RG1 9SP", "98105", "WG2 7LT"];
    var country = ["USA", "USA", "USA", "USA", "UK", "UK", "UK", "USA", "UK"];
    var homephone = ["(206) 555-9857", "(206) 555-9482", "(206) 555-3412", "(206) 555-8122", "(71) 555-4848", "(71) 555-7773", "(71) 555-5598", "(206) 555-1189", "(71) 555-4444"];
    var notes = ["Education includes a BA in psychology from Colorado State University in 1970. She also completed 'The Art of the Cold Call.' Nancy is a member of Toastmasters International.",
    "Andrew received his BTS commercial in 1974 and a Ph.D. in international marketing from the University of Dallas in 1981. He is fluent in French and Italian and reads German. He joined the company as a sales representative, was promoted to sales manager in January 1992 and to vice president of sales in March 1993. Andrew is a member of the Sales Management Roundtable, the Seattle Chamber of Commerce, and the Pacific Rim Importers Association.",
    "Janet has a BS degree in chemistry from Boston College (1984). She has also completed a certificate program in food retailing management. Janet was hired as a sales associate in 1991 and promoted to sales representative in February 1992.",
    "Margaret holds a BA in English literature from Concordia College (1958) and an MA from the American Institute of Culinary Arts (1966). She was assigned to the London office temporarily from July through November 1992.",
    "Steven Buchanan graduated from St. Andrews University, Scotland, with a BSC degree in 1976. Upon joining the company as a sales representative in 1992, he spent 6 months in an orientation program at the Seattle office and then returned to his permanent post in London. He was promoted to sales manager in March 1993. Mr. Buchanan has completed the courses 'Successful Telemarketing' and 'International Sales Management.' He is fluent in French.",
    "Michael is a graduate of Sussex University (MA, economics, 1983) and the University of California at Los Angeles (MBA, marketing, 1986). He has also taken the courses 'Multi-Cultural Selling' and 'Time Management for the Sales Professional.' He is fluent in Japanese and can read and write French, Portuguese, and Spanish.",
    "Robert King served in the Peace Corps and traveled extensively before completing his degree in English at the University of Michigan in 1992, the year he joined the company. After completing a course entitled 'Selling in Europe,' he was transferred to the London office in March 1993.",
    "Laura received a BA in psychology from the University of Washington. She has also completed a course in business French. She reads and writes French.",
    "Anne has a BA degree in English from St. Lawrence College. She is fluent in French and German."];
    var k = 0;
    for (var i = 0; i < firstNames.length; i++) {
    var row = {};
    row["firstname"] = firstNames[k];
    row["lastname"] = lastNames[k];
    row["title"] = titles[k];
    row["titleofcourtesy"] = titleofcourtesy[k];
    row["birthdate"] = birthdate[k];
    row["hiredate"] = hiredate[k];
    row["address"] = address[k];
    row["city"] = city[k];
    row["postalcode"] = postalcode[k];
    row["country"] = country[k];
    row["homephone"] = homephone[k];
    row["notes"] = notes[k];
    data[i] = row;
    k++;
    }
    var source =
    {
    localdata: data,
    datatype: "array"
    };
    var initrowdetails = function (index, parentElement, gridElement, datarecord) {
    var tabsdiv = null;
    var information = null;
    var notes = null;
    tabsdiv = $($(parentElement).children()[0]);
    if (tabsdiv != null) {
    information = tabsdiv.find('.information');
    notes = tabsdiv.find('.notes');
    var title = tabsdiv.find('.title');
    title.text(datarecord.firstname);
    var container = $('<div style="margin: 5px;"></div>')
    container.appendTo($(information));
    var photocolumn = $('<div style="float: left; width: 15%;"></div>');
    var leftcolumn = $('<div style="float: left; width: 45%;"></div>');
    var rightcolumn = $('<div style="float: left; width: 40%;"></div>');
    container.append(photocolumn);
    container.append(leftcolumn);
    container.append(rightcolumn);
    var photo = $("<div class='jqx-rc-all' style='margin: 10px;'><b>Photo:</b></div>");
    var image = $("<div style='margin-top: 10px;'></div>");
    var imgurl = '../../images/' + datarecord.firstname.toLowerCase() + '.png';
    var img = $('<img height="60" src="' + imgurl + '"/>');
    image.append(img);
    image.appendTo(photo);
    photocolumn.append(photo);
    var firstname = "<div style='margin: 10px;'><b>First Name:</b> " + datarecord.firstname + "</div>";
    var lastname = "<div style='margin: 10px;'><b>Last Name:</b> " + datarecord.lastname + "</div>";
    var title = "<div style='margin: 10px;'><b>Title:</b> " + datarecord.title + "</div>";
    var address = "<div style='margin: 10px;'><b>Address:</b> " + datarecord.address + "</div>";
    $(leftcolumn).append(firstname);
    $(leftcolumn).append(lastname);
    $(leftcolumn).append(title);
    $(leftcolumn).append(address);
    var postalcode = "<div style='margin: 10px;'><b>Postal Code:</b> " + datarecord.postalcode + "</div>";
    var city = "<div style='margin: 10px;'><b>City:</b> " + datarecord.city + "</div>";
    var phone = "<div style='margin: 10px;'><b>Phone:</b> " + datarecord.homephone + "</div>";
    var hiredate = "<div style='margin: 10px;'><b>Hire Date:</b> " + datarecord.hiredate + "</div>";
    $(rightcolumn).append(postalcode);
    $(rightcolumn).append(city);
    $(rightcolumn).append(phone);
    $(rightcolumn).append(hiredate);
    var notescontainer = $('<div style="white-space: normal; margin: 5px;"><span>' + datarecord.notes + '</span></div>');
    $(notes).append(notescontainer);
    $(tabsdiv).jqxTabs({ width: 600, height: 170, theme: theme });
    }
    }
    var dataAdapter = new $.jqx.dataAdapter(source);
    $("#jqxgrid").jqxGrid(
    {
    width: 670,
    height: 250,
    source: dataAdapter,
    theme: theme,
    rowdetails: true,
    showfilterrow: true,
    filterable: true,
    rowdetailstemplate: { rowdetails: "<div style='margin: 10px;'><ul style='margin-left: 30px;'><li class='title'></li><li>Notes</li></ul><div class='information'></div><div class='notes'></div></div>", rowdetailsheight: 200 },
    initrowdetails: initrowdetails,
    showtoolbar: true,
    toolbarheight: 35,
    rendertoolbar: function (toolbar) {
    var toolbarContainer = $("<div id='btnContainer' style='margin: 5px;'></div>");
    var header = $("<div id='hdr' style='float: left; margin-right: 50px; margin-left: 10px; margin-top: 5px;'><b>Report</b><span style='margin-left: 4px; position: relative; top: -2px;'></span></div>");
    filterButton = $("<div id='filterBtn' style='float: right; margin-left: 5px;'><img id='filterImg' style='position: relative; margin-top: 2px;' src='../images/nofilter.png'/><span style='margin-left: 4px; position: relative; top: -2px;'></span></div>");
    // add tooltips
    filterButton.jqxTooltip({ content: 'Click to remove all filters', position: 'mouse', name: 'addTooltip', theme: theme });
    toolbar.append(toolbarContainer);
    toolbarContainer.append(header);
    toolbarContainer.append(filterButton);
    // do not show filter button if no filters applied
    filterButton.hide();
    filterButton.jqxButton({theme: 'ui-redmond', width: 18,height: 18});
    },
    columns: [
    { text: 'First Name', filtertype: 'textbox',filtercondition: 'contains', datafield: 'firstname', width: 100 },
    { text: 'Last Name', datafield: 'lastname', width: 100 },
    { text: 'Title', datafield: 'title', width: 180 },
    { text: 'City', datafield: 'city', width: 100 },
    { text: 'Country', datafield: 'country', width: 140 }
    ]
    });
    // remove all filters if filter button clicked
    filterButton.click(function (event) {
    $("#jqxgrid").jqxGrid('clearfilters');
    filterButton.hide();
    });
    // show filter button if filters applied
    $("#jqxgrid").bind("filter", function (event) {
    // get list of selected filters
    filterinfo = $("#jqxgrid").jqxGrid('getfilterinformation');
    if(filterinfo.length == 0) {
    filterButton.hide();
    } else {
    filterButton.show();
    }
    });
    });
    </script>
    </head>
    <body class='default'>
    <div id='jqxWidget' style="font-size: 13px; font-family: Verdana; float: left;">
    <div id="jqxgrid"></div>
    </div>
    </body>
    </html>

    maurizio
    Participant

    Reformatted code for easier reading

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html lang="en">
    <head>
    <title id='Description'>jqxChart Pie Series Legend Example</title>
    <link rel="stylesheet" href="jqwidgets/jqwidgets/styles/jqx.base.css" type="text/css" />
    <script type="text/javascript" src="jqwidgets/scripts/jquery-1.8.2.min.js"></script>
    <script type="text/javascript" src="jqwidgets/jqwidgets/jqxcore.js"></script>
    <script type="text/javascript" src="jqwidgets/jqwidgets/jqxchart.js"></script>
    <script type="text/javascript" src="jqwidgets/jqwidgets/jqxdata.js"></script>
    <script type="text/javascript">
    $(document).ready(function () {
    // prepare amounts chart data
    var source2 = {
    datatype: "json",
    datafields: [
    { name: 'job_type', type: 'string'},
    { name: 'tot_invoiced', type: 'currency'}
    ],
    url: "getData.php?tableName=vw_all_invoiced_jobs_by_amount"
    };
    var dataAdapter2 = new $.jqx.dataAdapter(source2, { async: false, autoBind: true,
    loadError: function (xhr, status, error) {
    alert('Error loading "' + source.url + '" : ' + error); } });
    // prepare amounts chart settings
    var ctcAmt = {
    title: "Job breakdown by contract amount",
    description: "(Top 5 jobs - based on invoiced jobs)",
    enableAnimations: true,
    showLegend: true,
    legendLayout: { left: 350, top: 100, width: 300, height: 300, flow: 'vertical' },
    padding: { left: -180, top: 0, right: 5, bottom: 5 },
    titlePadding: { left: 0, top: 5, right: 0, bottom: 10 },
    source: dataAdapter2,
    colorScheme: 'scheme01',
    seriesGroups:
    [
    {
    type: 'pie',
    showLabels: true,
    click: drillToDetails,
    series:
    [
    {
    dataField: 'tot_invoiced',
    displayText: 'job_type',
    labelRadius: 70,
    initialAngle: 15,
    radius: 120,
    centerOffset: 10,
    formatSettings: {decimalPlaces: 2}
    }
    ]
    }
    ]
    };
    // setup the chart
    $('#amountChart').jqxChart(ctcAmt);
    $('#amountChart').jqxChart({toolTipShowDelay: 100});
    $('#amountChart').jqxChart({showBorderLine: true});
    // add a click event handler function to the 1st group
    function drillToDetails(e){
    var eventData = 'DataField: ' + e.serie.displayText + ', Value: ' + e.elementValue;
    alert(eventData);
    };
    });
    </script>
    </head>
    <body class='default'>
    <div id='amountChart' style="width: 600px; height: 350px; position: relative; left: 0px;
    top: 0px;">
    </div>
    </body>
    </html>

    maurizio
    Participant

    Hi Peter

    Apologies for hijacking the post but I tried to set the grid’s width to 100% but it does not seem to work. I am using version 2.5. Was this functionality added in a successive version?

    Thanks
    Maurizio


    maurizio
    Participant

    I have created a page that contains 3 panels separated by splitters and a jqxTree in the left panel. I have added some text to the main panel, but when I resize the browser window the text disappears to reappear again when the window is resized back to full screen. Does anybody have any idea why this happen? Please see code below to recreate issue

    Thanks – Maurizio

    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta name="description" content="The jqxDockPanel widget represents a container for other widgets
    or elements. It arranges its inner elements depending on the value of the 'dock' attribute." />
    <title id='Description'>Test System</title>
    <link rel="tomcat icon" href="images/tomcat.gif" type="image/x-icon" />
    <!--link href="css/Blue.css" rel="stylesheet" type="text/css"-->
    <link rel="stylesheet" href="jqwidgets/jqwidgets/styles/jqx.base.css" type="text/css" />
    <link rel="stylesheet" href="jqwidgets/jqwidgets/styles/jqx.ui-redmond.css" type="text/css" />
    <script type="text/javascript" src="jqwidgets/scripts/jquery-1.8.2.min.js"></script>
    <script type="text/javascript" src="jqwidgets/jqwidgets/jqxcore.js"></script>
    <script type="text/javascript" src="jqwidgets/jqwidgets/jqxbuttons.js"></script>
    <script type="text/javascript" src="jqwidgets/jqwidgets/jqxscrollbar.js"></script>
    <script type="text/javascript" src="jqwidgets/jqwidgets/jqxpanel.js"></script>
    <script type="text/javascript" src="jqwidgets/jqwidgets/jqxtree.js"></script>
    <script type="text/javascript" src="jqwidgets/jqwidgets/jqxexpander.js"></script>
    <script type="text/javascript" src="jqwidgets/jqwidgets/jqxsplitter.js"></script>
    <script type="text/javascript">
    $(document).ready(function () {
    var theme = 'ui-redmond'; //'ui-redmond darkblue';
    // Create jqxTrees
    $('#formsTree').jqxTree({
    theme: theme,
    enableHover: true,
    keyboardNavigation: true,
    toggleMode: 'click'
    });
    // Create jqxExpanders
    $('#formsExpander').jqxExpander({
    showArrow: true,
    expanded: true,
    toggleMode: 'click',
    width: 'auto',
    height: 'auto',
    theme: theme
    });
    // create nested panels and splitters
    $('#mainSplitter').jqxSplitter({
    theme: theme,
    orientation: 'horizontal',
    width: '100%',
    height: '100%',
    splitBarSize: '0px',
    panels: [{
    size: '14%',
    collapsible: false,
    resizable: false
    }, {
    size: '86%',
    collapsible: false
    }]
    });
    $('#firstNested').jqxSplitter({
    theme: theme,
    orientation: 'vertical',
    height: '100%',
    panels: [{
    size: '15%',
    collapsible: true
    }]
    });
    });
    </script>
    <style type="text/css">
    html, body {
    height: 100%;
    width: 100%;
    margin: 0px;
    padding: 0px;
    }
    </style>
    </head>
    <body style="background-image: url(); background-repeat: repeat-x; background-color: #CBE2F1;" >
    <div id="mainSplitter">
    <div id="header" style="background-image: url(Images/header.png); no-repeat; height: 100%; width: 100%;">
    <h1 style="margin-left: 5px;">Test System</h1>
    </div>
    <div class="splitter-panel" id="firstNested">
    <div class="splitter-panel" style="background-image: url(); background-repeat: repeat-x; background-color: #CBE2F1; overflow-x: auto; overflow-y: auto;">
    <div id='formsExpander'>
    <div>Entry Forms</div>
    <div id='formsTree'>
    <ul>
    <li item-expanded='true'>
    <img style='float: left; margin-right: 5px;' src='jqwidgets/images/entryForm.png' /><span item-title="true" onclick="$('#main').load('entryForm.php')">Account</span>
    </li>
    </ul>
    </div>
    </div>
    </div>
    <div class="splitter-panel" id="main" style="margin-left: 10px; overflow-x: auto; overflow-y: auto;">
    some stuff here
    </div>
    </div>
    </div>
    </body>
    </html>
    in reply to: loading webpage in window loading webpage in window #11710

    maurizio
    Participant

    Thank you very much for the link. The IFRAME works great.

    Maurizio


    maurizio
    Participant

    I can confirm that the issue has been corrected with version 2.5.5 (I was using 2.5.0)

    Thanks
    Maurizio


    maurizio
    Participant

    Just wondering if there has been any development/update on this issue

    Maurizio


    maurizio
    Participant

    Hi Dimitar

    Thanks for the reply. I had just found that out myself and was about to post an update but you just beat me to it. 🙂


    maurizio
    Participant

    Hi Peter

    I have pasted the updaterow function code below:

    			updaterow: function (rowid, rowdata, commit) {
    				var fields = tbl+',active';
    				var fldVals = $("#value").val()+','+ $("#activeValue").val();
    				var whereFld =  tbl+'_key';
    				var whereVal = $("#pkField").val();	
    				// calls update function and reloads grid
    				$.ajax({
    					type: "POST",
    					url: "getFunction.php",
    					data: "functionName=ITS_UpdateRows&tableName="+tbl+"&fields="+fields+"&values="+fldVals+"&pkField=none&whereFlds="+whereFld+"&whereVals="+whereVal,
    					success: function(msg){
    						$("#editWindow").jqxWindow('hide');
    						var dataAdapter = new $.jqx.dataAdapter(source);
                    		$("#jqxgrid").jqxGrid({ source: dataAdapter });
    					}
    				});
    				commit(true);
    			},		
    
    
    The function is called when clicking on the popup window's "Save" button:
    
    
     		$("#Save").click(function () {
    			if($("#value").val().length > 0){
    				var activeVal = 'N';
    				if (editrow >= 0) {				
    					if(document.getElementById("active").checked){
    						var activeVal = 'Y';
    					}
    					document.getElementById("activeValue").value = activeVal;
    					var row = {
    						: $("#pkField").val(), 
    						: $("#value").val(), 
    						active: activeVal 
    					};
    					$("#jqxgrid").jqxGrid('updaterow', editrow, row);	
    				}
    			} else {
    				$("#jqxgrid").jqxGrid('showvalidationpopup', editrow, "value", tblShowUC + " field cannot be empty");	
    			}
    		});
    

    maurizio
    Participant

    Hi again

    If i add commit(true) I can see from the console that I get a “Uncaught type error: undefined is not a function“. This does not seem to have any effect on the page processing, however and omitting the commit call does not seem to make any difference.

    If I don’t set the grid’s source again after editing a record the grid is updated only if no filters are applied. Whenever I update a record after having applied a filter the changes are not displayed, although the record is actually updated in the database. Maybe this is also something you can have a look at for the next version?

    Thanks for your help.
    Maurizio


    maurizio
    Participant

    Hi Peter and thanks for the quick reply.
    I have uncommented the filterable property but I still cannot get the filter list to update

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