jQWidgets Forums
Forum Replies Created
-
Author
-
November 5, 2015 at 10:39 am in reply to: get dropdown id instead for display name on change event of dependent dropdowns get dropdown id instead for display name on change event of dependent dropdowns #77792
Hi Dimitar,
Anyway will check out your code and update ( as you had said i am not storing the status id’s in any other column )Meanwhile,You can see that i use the following code to update the dropdown with Statusname along with their id’s
Which is fetched from the database using this function
geturl=base_url + "dailyactivity/getldstatus";
which gives me the result array asstatusid statusname
======== ==========
1 Prospect
2 Met the customer
3 Credit Assessment
4 Sample,Trails & Formalities
5 Enquiry/Offer/Negotiation
6 Managing And Implementation
and i bind these values using the below code.resultsEditorldst: function(row, cellvalue, editor){ var data = $('#jqxgrid_add').jqxGrid('getrowdata', row); var leadid =data.leadid; // alert("leadid in resultsEditorldst "+leadid); if (leadid!="") { geturl=base_url + "dailyactivity/getldstatusfor/"+leadid; } else { geturl=base_url + "dailyactivity/getldstatus"; } var stslist = { datatype: "json", datafields: [ {name: 'statusid'}, {name: 'statusname'} ], id: 'statusid', root: "statusid", url: geturl, cache: false, async: false }; stslistdataAdapter = new $.jqx.dataAdapter(stslist, { autoBind: true, buildSelect: function (suboptions) { console.log(suboptions); var data = new Array(); $.each(suboptions, function (id, value) { var stslist = records[i]; <strong> stslist.statusid = list.statusid; stslist.statusname = stslist.statusname; </strong> data.push(stslist); }); return data; } }); editor.jqxDropDownList( { source: stslistdataAdapter.records, displayMember: "statusname",autoDropDownHeight: true, valueMember: "statusid",promptText:"Status",selectedIndex:0,placeHolder: 'Select status',renderer: function (index, label, value) { var option = '<div value="' + value + '">' + label + '</div>'; return option; } }); },
November 5, 2015 at 4:54 am in reply to: get dropdown id instead for display name on change event of dependent dropdowns get dropdown id instead for display name on change event of dependent dropdowns #77776Hi Dimitar,
i tried adding this code..but i still get the Statusname only in the alertid Statusname
== =========
1 Prospect
2 Met the customer
3 Credit Assessment
4 Sample,Trails & Formalities
5 Enquiry/Offer/Negotiation
6 Managing And Implementation{text: 'Status', datafield: 'statusid', width: 150, cellsalign: 'center', cellbeginedit:Results.initResultsEditorldst, initeditor: Results.resultsEditorldst, cellsrenderer: Results.renderUnitsldst,promptText:'Select Status', cellvaluechanging: function (row, datafield, columntype, oldvalue, newvalue) { alert("oldvalue "+oldvalue); alert("newvalue "+newvalue); // alert("datafield "+datafield); var sid = $('#jqxgrid_add').jqxGrid('getcellvalue', row, "statusid"); alert('statusid: ' + sid); if (newvalue == 0) { return oldvalue; } else if (newvalue!=oldvalue) { $("#jqxgrid_add").jqxGrid('setcellvalue', row, "leadsubstatusid", "Select Substatus"); return newvalue; } } },
November 4, 2015 at 12:51 pm in reply to: set checkbox value as checked or unchecked based on other column set checkbox value as checked or unchecked based on other column #77747Thanks Dimitar
September 10, 2015 at 5:11 am in reply to: editor jqxDropDownList bind different values in grid for each row editor jqxDropDownList bind different values in grid for each row #75717Hi Dimitar,
the code works fine, i had missed the returning the value in the datafield ‘leadid’, i was returning “No Leads” text onlyold code
if($activitydetails[$i]["leadid"]==0) { $row["leadid"] = "No Leads"; }
new code
if($activitydetails[$i]["leadid"]==0) { $row["leadid"] = "No Leads"; } else { $row["leadid"] = $activitydetails[$i]["leadid"]; }
the leadid’s are loaded from db as desired
September 10, 2015 at 1:34 am in reply to: editor jqxDropDownList bind different values in grid for each row editor jqxDropDownList bind different values in grid for each row #75707Hi Dimitar,
This is for follow up of the above code, i want to display the leadid’s while loading the grid(jqxgrid_n) of the each if it exists in the database,
the datafield is ‘leadid’ which has the leadid value or 0.$("#jqxgrid").jqxGrid( { width: 760, height: 500, source: dataAdapter, theme: 'energyblue', sortable: true, pageable: true, columnsresize: true, editable: false, showfilterrow: true, filterable: true, autoheight: true, showtoolbar: true, pageable: true, rendertoolbar: toolbarfunc, columns: [ {text: 'ID', datafield: 'id', width: 60}, { text: 'Visit Date', datafield: 'currentdate', columntype: 'datetimeinput', width: 110, align: 'left', cellsalign: 'left', cellsformat: 'd', formatString: 'd' /* , validation: function (cell, value) { if (value == "") return true; var year = value.getFullYear(); if (year >= 2014) { return { result: false, message: "Ship Date should be before 1/1/2014" }; } return true; }*/ }, {text: 'User Code', columntype: 'dropdownlist', filterable: 'enable', datafield: 'execode', width: 75}, {text: 'User Name', datafield: 'exename', width: 150, cellsalign: 'left'}, {text: 'Branch', datafield: 'branch', width: 150, cellsalign: 'left'}, {text: 'Created Date', datafield: 'creationdate', columntype: 'datetimeinput', width: 110, align: 'left', cellsalign: 'left', cellsformat: 'd', formatString: 'd'}, {text: 'Update', cellsalign: 'center', datafield: 'Update', filterable: false, width: 100, columntype: 'button', cellsrenderer: function () { return "Update"; }, buttonclick: function (row) { // popup function start actionmode = "update"; var rowindex = $("#jqxgrid").jqxGrid('getselectedrowindex'); var headerid = $("#jqxgrid").jqxGrid('getcellvalue', rowindex, 'id'); header_date = $("#jqxgrid").jqxGrid('getcellvalue', rowindex, 'currentdate'); username = $("#jqxgrid").jqxGrid('getcellvalue', rowindex, 'exename'); branch = $("#jqxgrid").jqxGrid('getcellvalue', rowindex, 'branch'); dhdr_headerid = headerid; $('#username').jqxInput('val', username); $('#branch').jqxInput('val', branch); var t = $('#hdn_hdr_id').val(); $('#hdn_hdr_id').val(dhdr_headerid); var g = $('#hdn_hdr_id').val(); var rows = new Array(); var columns = new Array(); jQuery.ajax({ dataType: "html", url: 'dailyactivity/get_edit_data/' + headerid, type: "POST", async: false, error: function (xhr, status) { alert("check " + status + " test"); }, success: function (result) { var obj = jQuery.parseJSON(result); columns = obj[0].columns; rows = obj[1].rows; commonCols = obj[0].columns; } }); var source = { datatype: "json", datafields: [], id: 'id', localdata: rows }; var dataAdapter = new $.jqx.dataAdapter(source); header_date = convert(header_date); $('#update_header_date').jqxInput({width: '100px', height: '25px', disabled: true}); $('#update_header_date').val(header_date); $("#jqxgrid_n").jqxGrid( { width: '100%', height: 300, source: dataAdapter, theme: 'energyblue', columnsresize: true, selectionmode: 'rowselect', editable: true, editmode: 'click', sortable: true, pageable: true, columnsresize: true, sortable: true, showfilterrow: false, filterable: true, columns: [ {text: 'UID', datafield: 'id', width: 150, cellsalign: 'left', hidden: true}, {text: 'Customer Group', datafield: 'custgroup', width: 150, editable: false}, {text: 'Product Group', datafield: 'itemgroup', width: 150, cellsalign: 'left', editable: false}, {text: 'Lead id', datafield: 'leadid', displayfield: 'leadid', width: 127, cellsalign: 'center', cellbeginedit: Resultsupdate.initResultsEditor, initeditor: Resultsupdate.resultsEditor, cellsrenderer: Resultsupdate.renderUnits,promptText:'Select Leadid',cellvaluechanging: function (row, datafield, columntype, oldvalue, newvalue) { // alert("oldvalue "+oldvalue); alert("newvalue "+newvalue); if (newvalue == 0) { return oldvalue; } } }, {text: 'noofleads', datafield: 'noofleads',hidden:true, width: 20, cellsalign: 'left', editable: false}, {text: 'result_type', datafield: 'result_type',hidden:true, width: 75, cellsalign: 'left', editable: false}, {text: 'Activity Type', datafield: 'subactivity', width: 110, cellsalign: 'left', cellbeginedit:Resultsupdate.initResultsEditorat, initeditor: Resultsupdate.resultsEditorat, cellsrenderer: Resultsupdate.renderUnitsat }, {text: 'Potential', datafield: 'potentialqty', width: 75, cellsalign: 'left', editable: false}, {text: 'Required Quantity', datafield: 'quantity', width: 75, cellsalign: 'left', cellbeginedit: function (row, datafield, columntype) { var rowdata = $("#jqxgrid_n").jqxGrid('getrowdata', row); var leadid = rowdata.leadid; // alert("leadid in quantity cell rendering "+leadid); if(leadid==undefined || leadid==0) { return true; } else { return false; } } }, {text: 'Sales Type', datafield: 'division', width: 110, cellsalign: 'left',readonly:true,cellbeginedit:Resultsupdate.initResultsEditorst, initeditor: Resultsupdate.resultsEditorst, cellsrenderer: Resultsupdate.renderUnitsst }, /*{text: 'Mode of Contact', datafield: 'modeofcontact', width: 100, cellsalign: 'left', columntype: 'dropdownlist', createeditor: function (row, cellvalue, editor) { editor.jqxDropDownList({source: ["E-mail", "Phone", "Visit"]}); } },*/ {text: 'Mode of Contact', datafield: 'modeofcontact', width: 100, cellsalign: 'left', cellbeginedit:Resultsupdate.initResultsEditorcon, createeditor: Resultsupdate.resultsEditorcon, cellsrenderer: Resultsupdate.renderUnitsst }, {text: 'Time Spent (Hrs)', datafield: 'hour_s', width: 75, cellsalign: 'left', columntype: 'dropdownlist', createeditor: function (row, cellvalue, editor) { editor.jqxDropDownList({source: ["00 Hr", "01 Hrs", "02 Hrs", "03 Hrs", "04 Hrs", "05 Hrs", "06 Hrs", "07 Hrs", "08 Hrs", "09 Hrs", "10 Hrs"]}); } }, {text: 'Time Spent (Mins)', datafield: 'minit', width: 75, cellsalign: 'left', columntype: 'dropdownlist', createeditor: function (row, cellvalue, editor) { editor.jqxDropDownList({source: ["0 mins", "5 mins", "10 mins", " 15 mins", "20 mins", "25 mins", "30 mins", " 35 mins", "40 mins", "45 mins", " 50 mins", "55 mins"]}); } }, {text: 'Notes / Remarks', datafield: 'remarks', width: 150, cellsalign: 'left'}, ] }); var x = ($(window).width() - $("#customWindow").jqxWindow('width')) / 2 + $(window).scrollLeft(); var y = ($(window).height() - $("#customWindow").jqxWindow('height')) / 2 + $(window).scrollTop(); $("#customWindow").jqxWindow({ position: { x: x, y: y} }); $('#customWindow').jqxWindow('open'); $('#customWindow').jqxWindow({width: "100%"}); } // end of popup edit button click event }, ] });
inserting images for your references in order the order how i want it to be
This is how it loads by default (no leadid is loaded even if the leadid present in the database)
Loads the leadid, only when we click on that particular cell
This is how i am trying to load
August 28, 2015 at 12:41 pm in reply to: editor jqxDropDownList bind different values in grid for each row editor jqxDropDownList bind different values in grid for each row #75269Thanks Dimitar, yes worked fine..as per your suggestion, was missing the div tag.
August 28, 2015 at 10:31 am in reply to: editor jqxDropDownList bind different values in grid for each row editor jqxDropDownList bind different values in grid for each row #75257Hi Dimitar,
i have one more issue related to display
the leadid’s are not displayed in the chrome browser
below is the reference image for chrome, you can see the size of dropdown is list for two leadid’s but not visible</p>
Where as in firefox,you can see the difference, the leadid’s are displayed in the dropdown list
</p>
i guess, is it related to async or cache property..?
August 28, 2015 at 10:13 am in reply to: editor jqxDropDownList bind different values in grid for each row editor jqxDropDownList bind different values in grid for each row #75256Thanks Dimitar, yes worked fine..as per your suggestion.
July 25, 2014 at 12:23 pm in reply to: Cascading Drop Down Lists in Grid Cascading Drop Down Lists in Grid #57710Hi sushengloong,
I am also looking for a solution as yours.i have a two dropdownlist in a grid, status and substatus, i want load the substatus values based on the changed status in the first dropdownlist. Did you find a solution, can you please help me out.
July 25, 2014 at 12:20 pm in reply to: dependend dropdownlist on grid dependend dropdownlist on grid #57709Hello Lalit Singh,
I am also looking for the same solution as yours, i have a two dropdownlist in a grid, status and substatus, i want load the substatus values based on the changed status in the first dropdownlist.
-
AuthorPosts