jQWidgets Forums

jQuery UI Widgets Forums Grid jqxInput on Grid

This topic contains 5 replies, has 2 voices, and was last updated by  mac 9 years, 8 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • jqxInput on Grid #77370

    mac
    Participant

    Hi
    I have jqxInput(editable cell) on grid.
    I am unable to apply force selection on the same.
    i am using createeditor to embed jqxInput, and the ‘row’ is always same(the very first edited row).
    following the way i coded for force selection

    
      createeditor: function (row, cellvalue, editor, cellText, width, height) {
                    		var countrySelected = false;
    					    var inputElement = $("<input/>").prependTo(editor);
                            inputElement.jqxInput({ popupZIndex: 2000000001, source: countrySource, width:width,height:height});
                            inputElement.on('close',
                            		function () {
    		                        	if (countrySelected === false) {
    		                        		//rValue='';
    		                        		alert("row # is always ="+row);
    		                        	}
                            });
                            
                            inputElement.on('open', 
                            		function(){  
                            	countrySelected = false;
                            });
                            	
                            inputElement.on('select',
                            		function () {
                            	countrySelected=true;
                            });
                        },

    full code is here https://jsfiddle.net/jhbqxhg3/1/

    jqxInput on Grid #77371

    mac
    Participant

    in the above on ‘close’ event, i’d like to check if there was a selection, if NO wanted to blank the cell.
    But the ‘row’ was always first edited row.
    any thing wrong there? or any better approach?

    jqxInput on Grid #77395

    Peter Stoev
    Keymaster

    Hi mac,

    The function is implemented in the “createeditor” and there the “row” argument is the “row” passed by the function. The function is called 1 time when the Editor is created so the “row” is unchanged.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    jqxInput on Grid #77400

    mac
    Participant

    Thanks for the response Peter.
    How can we implement force selection in jqxInput? (jqxInput is on jqxgrid cell)

    jqxInput on Grid #77419

    mac
    Participant

    Hi Everyone,
    Any possibilities of force selection in jqxInput(on editable cell)?
    in the above code example, i managed to capture the events and figured out if jqxInput’s selection is done or not.
    But i cant set the value to blank if no selection is made.
    From editor can we update the value?

    jqxInput on Grid #77422

    mac
    Participant

    Hi, i found a solution for this.
    bind the column with cellvaluechanging event

    		            cellvaluechanging: cellvaluechanging,
    
     
    and
    var cellvaluechanging = function (row, datafield, columntype, oldvalue, newvalue) {
    			     if (countrySelected ) {
    			         return newvalue;
    			     }
    			     return oldvalue;
    			 }
Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.