规则html表单对象赋值

function grid_load_callback(data, status) {
            if (data.rows.length > 0)
            {
                var inputlist = $('input');

//获取数据对象,以循环赋值
                var obj=data.rows[0];
                for (var id in obj)
                {
                    if ($.objExists('txt' + id))
                        $.setValue('txt' + id, obj[id]);
                }
                //$.setValue("txtyaosi", '1');
            }
            // alert(JSON2.stringify(data));
            $("#dg").datagrid("loadData", data);
            $.closeWaiting();
        }

objExists: function(id){
        if(this("#"+id).length>0)
            return true;
        else false;
    },
    setValue: function (id, value) {
        this("#" + id).val(value);
    },

上一篇:JS获取电脑或手机屏幕的分辨率


下一篇:C++实验三