Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-08-2012, 10:20 AM   PM User | #1
naveendk.55
New Coder

 
Join Date: Aug 2011
Posts: 88
Thanks: 5
Thanked 0 Times in 0 Posts
naveendk.55 is an unknown quantity at this point
Question Jquery : Object doesn't support this property or method

I am trying to using a tree structure on my JSP Page along with Jquery. Tree Structure requires to import few Jquery files. When I run the JSP page, I get the error code "Object doesn't support this property or method".

I tested the code by running the Tree Structure (Dyna Tree) code seperately and it works fine. Then I tried running the Jquery that I have written and it also works fine. The above mentioned error only appears if I integrate both the code. I have writted my custom code and error where exactly it appears. I am also using JEASYUI in my JSP Page. #fm belongs to JEASYUI.

Following are JEASY UI.

Code:
	<link rel="stylesheet" type="text/css" href="http://www.jeasyui.com/easyui/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="http://www.jeasyui.com/easyui/themes/icon.css">
	<link rel="stylesheet" type="text/css" href="http://www.jeasyui.com/easyui/demo/demo.css">
 
	<script type="text/javascript" src="http://www.jeasyui.com/easyui/jquery.easyui.min.js"></script>
Following is my custom code.

Code:
<script type="text/javascript">
        var url;
    function newUser(){
        $('#dlg').dialog('open').dialog('setTitle','Create New Access');
        $('#fm').form('clear');   // ERROR AT THIS LINE
        url = 'saveaccess.jsp'; 
    }
    function editUser(){
        var row = $('#dg').datagrid('getSelected');
        if (row){
            $('#dlg').dialog('open').dialog('setTitle','Edit Access');
            $('#fm').form('load',row);
            alert("test"+row);
            //url = 'AddNeditApplication.jsp';
        }
    }
    function saveUser(){
        $('#fm').form('submit',{
            url: url,
            onSubmit: function(){
                return $(this).form('validate');
            },
            success: function(result){
                //var result =new Object();
                alert(result);

                if (result){
                    $('#dlg').dialog('close');      // close the dialog
                    $('#dg').datagrid('reload');    // reload the user data
                } else {
                    $.messager.show({
                        title: 'Error',
                        msg: result.msg
                    });
                }
            }
        });
    }
    function removeUser(){
        var row = $('#dg').datagrid('getSelected');
        if (row){
            $.messager.confirm('Confirm','Are you sure you want to remove this Access?',function(r){
                if (r){
                    $.post('AddNeditApplication.jsp',{id:row.id},function(result){
                        if (result.success){
                            $('#dg').datagrid('reload');    // reload the user data
                        } else {
                            $.messager.show({   // show error message
                                title: 'Error',
                                msg: result.msg
                            });
                        }
                    },'json');
                }
            });
        }
    }

</script>
naveendk.55 is offline   Reply With Quote
Old 10-08-2012, 10:50 PM   PM User | #2
DanInMa
Senior Coder

 
DanInMa's Avatar
 
Join Date: Nov 2010
Location: Salem,Ma
Posts: 1,307
Thanks: 12
Thanked 204 Times in 204 Posts
DanInMa is on a distinguished road
thats becuase .form('clear') isnt a jQuery function.=, is it from some plugin perhaps?
also i dont see where you have linked the jQuery library itself.
__________________
- Firebug is a web developers best friend! - Learn it, Love it, use it!
- Validate your code! - JQ/JS troubleshooting
- Using jQuery with Other Libraries - Jslint for Jquery/other JS library users
DanInMa is offline   Reply With Quote
Old 10-10-2012, 07:52 AM   PM User | #3
naveendk.55
New Coder

 
Join Date: Aug 2011
Posts: 88
Thanks: 5
Thanked 0 Times in 0 Posts
naveendk.55 is an unknown quantity at this point
Question

$('#fm').form('clear'); is part of jeasyui plugin. Jquery is included. If I remove the tree structure related jquery code, then $('#fm').form('clear'); works fine.
naveendk.55 is offline   Reply With Quote
Reply

Bookmarks

Tags
javascript, jquery, jsp

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:49 PM.


Advertisement
Log in to turn off these ads.