Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
3790
need a $("input.ui-igedit-field") alternative.
posted

I have this bit of code that I use to edit input fields. The example I was given is something like:

 editCellStarted: function ( evt, ui )
                    {
                        var input = $( "input.ui-igedit-field" );

... do stuff.


I ran in to an issue when I use a pop out feature we created to copy the entire div and put it in to a new window. The problem is that the new window does not understand the css "input.ui-igedit-field" . So input is null.  Unfortunately I dont know enough about that line to make this work. I'm guessing it makes a Jquery object form the css on a cell. Since my new pop up page does not have access to a "input.ui-igedit-field" I need to make this code work another way.

full code:

editCellStarted: function ( evt, ui )
                    {
                        var input = $( "input.ui-igedit-field" );
                        
                        setTimeout( function ()
                        {
                            //if we have a keypress in the buffer replace the text otherwise move the cursor.
                            if ( INSTANCE.cellSelectionEditModeAscii != null )
                            {
                                input.val( INSTANCE.cellSelectionEditModeAscii )
                            }
                            else
                            {
                                input.val( INSTANCE.oldEditValue );
                                input.prop( "selectionStart", input.val().length ).select();
                            }
                           
                            INSTANCE.cellSelectionEditModeAscii = null;
                            document.getElementById( "myContentValue" + INSTANCE.ID ).value = input.val();

                        }, 150 );

                    },

Parents
No Data
Reply Children