Forum Replies Created

Viewing 15 posts - 16 through 30 (of 50 total)
  • Author
    Posts
  • in reply to: Set value of Cell Editor Set value of Cell Editor #56873

    Benji6996
    Participant

    Thanks Peter! 🙂

    I know how to use the ‘initeditor’ callback, but how do I use it with the ‘celldoubleclick’ event?

    in reply to: Displaying On Intitiation Displaying On Intitiation #56305

    Benji6996
    Participant

    All sorted, there was a hidden piece of code in a third party plugin that was applying visibility:visible to all children of my dialog.

    Thanks anyway

    in reply to: Displaying On Intitiation Displaying On Intitiation #56302

    Benji6996
    Participant

    I have figured out what is happening but I do not know why. The menu’s that I am initiating within my popup are being given a ‘visibility’ of ‘visible’. Is there any reason why this could be happening?

    in reply to: Highlight Custom Rows Highlight Custom Rows #56290

    Benji6996
    Participant

    I have achieved this using the ‘cellclassname’ callback function like so:

    var cellclass = function(row,column,value,data){
    	if(typeof data!=='undefined'){
    		// Determine what styles to apply
    		switch(data.item_type){
    			case 'C':
    				return 'jqx-grid-cell-alt jqx-grid-cell-alt-'+theme;
    			break;
    		}
    	}
    };

    Is this the best method to achieve this?

    in reply to: Catch Key Press Cell Edit Catch Key Press Cell Edit #55439

    Benji6996
    Participant

    Brilliant, thanks very much Peter! 🙂


    Benji6996
    Participant

    Also, what is the best method to catch a key press for the cell so that I can prevent the cellendedit method being called when the Enter key is pressed?


    Benji6996
    Participant

    Think I have sorted it, but just one thing I should probably point out as it may be a typing error…

    In the example, the parameters for initeditor are function(row, cellvalue, editor, celltext, pressedkey), but in the docs they are function(row, cellvalue, editor, celltext, cellwidth, cellheight). Am I missing something?


    Benji6996
    Participant

    Gosh! Its always the small things you miss isn’t it!!! I will have another play. Sorry about that 🙂


    Benji6996
    Participant

    I have taken a good look at the method you have suggested but what is unclear is how I remove the editor instead of applying a jqx widget to it… I need to remove the input and replace it with a textarea but when I call editor.remove() I then get errors later on.

    From what I can understand thus far:

    createeditor: function(parameters...){
       // Create the textarea here and replace the editor with the textarea
    },
    initeditor: function(parameters...){
       // Place the value of the cell into the textarea
    }
    geteditorvalue: function(parameters...){
       // Return the value of the textarea
    }

    Whilst the above seems correct, if I call editor.remove() then initeditor and geteditorvalue will not be able to access editor and I will receive errors. Would you be able to advise my algorithm a little better?


    Benji6996
    Participant

    I will take another look. Thank you Peter


    Benji6996
    Participant

    Thank you for your prompt reply! 🙂

    I have been referring to this page when writing my script but I found some problems with it which I couldn’t get around… For instance, when I did the following, it just placed a textarea within an input in the DOM:

    var textarea= $("<textarea>").prependTo(editor);

    and this would result in:

    <input jqxstuffhere...>
        <textarea></textarea>
    </input>

    So with that in mind, I wrote my own method. Are you saying that I can achieve what I would like if I use the methods highlighted on this page?


    Benji6996
    Participant

    Thanks to another answer I have found within this forum, I was able to fix this issue like so:

    $.each(data.columns,function(index,value){
    	// If the column is a number input then apply the number input editor
    	if(data.columns[index].columntype=='numberinput'){
    		// Append the relevant column object with the createeditor callback
    		data.columns[index] = $.extend({
    			createeditor: function(row,cellvalue,editor){
    				editor.jqxNumberInput({
    					decimal: cellvalue,
    					inputMode: 'simple',
    					max: 99999999999999999999,
    					min: -99999999999999999999,
    					decimalDigits: data.columns[index].decimal_places,
    					decimalSeparator: data.localization.decimalseparator,
    					digits: 20
    				});
    			}
    		},data.columns[index]);
    	}
    });
    in reply to: Create Editor Dynamically Create Editor Dynamically #55258

    Benji6996
    Participant

    Apologies for this thread, very dumb mistake from me. I forgot to put columntype: 'numberinput'

    All sorted 🙂

    in reply to: Destroy Grid Error Destroy Grid Error #54942

    Benji6996
    Participant

    Hi Peter,

    Thank you for getting back to me. I updated to 3.2.2 thinking that would probably sort it but unfortunately it hasn’t…

    When I run $('#some_grid').jqxGrid('destroy');, I am still receiving the error: Uncaught TypeError: Cannot read property ‘coord’ of undefined…

    The ‘destroy’ method succeeds in removing the grid, but it seems to leave the code for the filter popup. So, when I create the grid again, there is duplicate code throughout the DOM (the duplicate code bug is fixed in version 3.2.2, as in, it doesn’t create another div as it detects that it is already there)…

    Would you like me to try and create a jsFiddle as an example of this?

    in reply to: Destroy Grid Error Destroy Grid Error #54841

    Benji6996
    Participant

    I have looked into this further and it appears that the error only occurs when filterable:true is specified. I think this may be the same issue as: http://www.jqwidgets.com/community/topic/maybe-a-bug-in-destroy-method-when-using-filtering/

    Is there a solution yet?

Viewing 15 posts - 16 through 30 (of 50 total)