jQuery UI Widgets Forums Grid rowselect is only ever triggered once?

This topic contains 1 reply, has 2 voices, and was last updated by  svetoslav_borislavov 2 years, 1 month ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • rowselect is only ever triggered once? #123727

    Buggs2015
    Participant

    Hello,

    I have a strange problem with the jqxGrid module.

    It appears from the specified code that the rowselect only gets triggered once when I execute the function (an alert box pops up letting me know the lastname). If I execute the very same function again for a second time, I do not get my alert box? Very strange and I can’t seem to wrap my head around what the problem could be?

    <script type="text/javascript" src="/scripts/jquery-1.12.4.min.js"></script>
    <script type="text/javascript" src="/scripts/jqxcore.js"></script>
    <script type="text/javascript" src="/scripts/jqxbuttons.js"></script>
    <script type="text/javascript" src="/scripts/jqxscrollbar.js"></script>
    <script type="text/javascript" src="/scripts/jqxmenu.js"></script>
    <script type="text/javascript" src="/scripts/jqxgrid.js"></script>
    <script type="text/javascript" src="/scripts/jqxgrid.selection.js"></script> 
    <script type="text/javascript" src="/scripts/jqxgrid.columnsresize.js"></script> 
    <script type="text/javascript" src="/scripts/jqxdata.js"></script>
    <script type="text/javascript" src="/scripts/jqxgrid.sort.js"></script>
    <script type="text/javascript">
    
    function search_db() {
    
    	var source =  {
    		datatype: "json",
    		datafields: [
    			{ name: 'Floor', type: 'int' },
    			{ name: 'Office' },
    			{ name: 'Location' },
    			{ name: 'Occupancy' },
    			{ name: 'Ownership' },
    			{ name: 'Workspace_Notes' },
    			{ name: 'RC' },
    			{ name: 'Project' },
    			{ name: 'Branch' },
    			{ name: 'Division' },
    			{ name: 'Lastname' },
    			{ name: 'Firstname' },
    			{ name: 'Tenure' },
    			{ name: 'Classification' },
    			{ name: 'Position_Number' },
    			{ name: 'Start_Date' },
    			{ name: 'End_Date' },
    			{ name: 'Employee_Status' }
    		],
    		id: 'id',
    		url: 'compile_data.asp',
    		data: { query: document.getElementById('input_txt_search').value }
    	}
    
    	var dataAdapter = new $.jqx.dataAdapter(source)
    
    	$("#jqxGrid").jqxGrid({
    			width: '100%',
    			height: '200px',
    		        source: dataAdapter,
    		        columnsresize: true,
    			sortable: true,
    			selectionmode: 'singlerow',
    		        columns: [
    		            { text: '<b>Floor</b>', datafield: 'Floor', width: 150 },
    		            { text: '<b>Office</b>', datafield: 'Office', width: 150 },
    		            { text: '<b>Location</b>', datafield: 'Location', width: 150 },
    		            { text: '<b>Occupancy</b>', datafield: 'Occupancy', width: 150 },
    		            { text: '<b>Ownership</b>', datafield: 'Ownership', width: 150 },
    		            { text: '<b>Workspace Notes</b>', datafield: 'Workspace_Notes', width: 150 },
    		            { text: '<b>RC</b>', datafield: 'RC', width: 150 },
    		            { text: '<b>Project</b>', datafield: 'Project', width: 150 },
    		            { text: '<b>Branch</b>', datafield: 'Branch', width: 150 },
    		            { text: '<b>Division</b>', datafield: 'Division', width: 150 },
    		            { text: '<b>Lastname</b>', datafield: 'Lastname', width: 150 },
    		            { text: '<b>Firstname</b>', datafield: 'Firstname', width: 150 },
    		            { text: '<b>Tenure</b>', datafield: 'Tenure', width: 150 },
    		            { text: '<b>Classification</b>', datafield: 'Classification', width: 150 },
    		            { text: '<b>Position Number</b>', datafield: 'Position_Number', width: 150 },
    		            { text: '<b>Start Date</b>', datafield: 'Start_Date', width: 150 },
    		            { text: '<b>End Date</b>', datafield: 'End_Date', width: 150 },
    		            { text: '<b>Employee Status</b>', datafield: 'Employee_Status', width: 150 }
    		        ],
    			ready: function() {
    				$('#jqxGrid').jqxGrid('selectrow', 0)
    			}
    	});
    
    	$('#jqxGrid').on('rowselect', function (event) {
    		
    		var i = event.args.rowindex
    
    		var d =  $("#jqxGrid").jqxGrid('getrowdata', i)
    		
    		alert(d.Lastname)
    
    	});
    
    }//end function
    
    rowselect is only ever triggered once? #123738

    Hi,

    I am very sorry, I couldn’t reproduce the error. What version are you using?
    May you please, send a demo of the problem here: svetoslav@jqwidgets.com

    Best regards,
    Svetoslav Borislavov

    jQWidgets Team
    https://www.jqwidgets.com/

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

You must be logged in to reply to this topic.