this.ds is undefined

本文探讨了在开发过程中遇到的JS布局错误,并详细解释了如何通过引入store来解决问题。文章强调了store在实现数据管理和状态管理中的关键作用,以及在避免布局混乱时的重要性。同时,提供了一个简单的示例来展示store的正确使用方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

	//fields end
    	InpatientViewPanel.superclass.constructor.call(this,{
    		region:"center",
    		height:400,
    		title:"医院住院病人信息",
    		viewConfig: {
    		        forceFit: true
    		},
    		//store:new Ext.data.Store({
    		//	fields:this.fields,
    		//	autoLoad:false,
    	//	//	url:"test.action"
    	//	}),
    		colModel:this.columnModel  
    	});

在之前只是想写一个页面暂时不写后台,但是这个时候出现一个错误this.ds is undefined,布局也是乱的,

后来才发现需要写一个store(注意上面注释的是在报错之前没有写) ,之后加上store后就OK了,随便写一个地址,autoLoad为false就好 了,


*** Using Compiler 'V5.06 update 7 (build 960)', folder: 'D:\qianrushi.app\ARM\bianyiqi\Bin' compiling ds18b20.c... ds18b20.h(1): error: #77-D: this declaration has no storage class or type specifier *** Using Compiler 'V5.06 update 7 (build 960)', folder: 'D:\qianrushi.app\ARM\bianyiqi\Bin' ds18b20.h(1): error: #65: expected a ";" *** Using Compiler 'V5.06 update 7 (build 960)', folder: 'D:\qianrushi.app\ARM\bianyiqi\Bin' ds18b20.h(1): error: #26: too many characters in character constant *** Using Compiler 'V5.06 update 7 (build 960)', folder: 'D:\qianrushi.app\ARM\bianyiqi\Bin' ds18b20.h(1): warning: #192-D: unrecognized character escape sequence *** Using Compiler 'V5.06 update 7 (build 960)', folder: 'D:\qianrushi.app\ARM\bianyiqi\Bin' ds18b20.h(1): warning: #192-D: unrecognized character escape sequence *** Using Compiler 'V5.06 update 7 (build 960)', folder: 'D:\qianrushi.app\ARM\bianyiqi\Bin' ds18b20.h(1): warning: #192-D: unrecognized character escape sequence *** Using Compiler 'V5.06 update 7 (build 960)', folder: 'D:\qianrushi.app\ARM\bianyiqi\Bin' ds18b20.h(1): error: #26: too many characters in character constant *** Using Compiler 'V5.06 update 7 (build 960)', folder: 'D:\qianrushi.app\ARM\bianyiqi\Bin' ds18b20.h(3): error: #10: "#" not expected here ds18b20.c(67): error: #254: type name is not allowed ds18b20.h(5): error: #10: "#" not expected here ds18b20.c(67): error: #65: expected a ";" ds18b20.h(7): error: #10: "#" not expected here ds18b20.c(67): error: #20: identifier "i" is undefined ds18b20.h(9): error: #10: "#" not expected here ds18b20.c(99): error: #254: type name is not allowed ds18b20.h(11): error: #10: "#" not expected here ds18b20.c(99): error: #65: expected a ";" ds18b20.h(13): error: #10: "#" not expected here ds18b20.c(99): error: #20: identifier "i" is undefined ds18b20.h(15): error: #10: "#" not expected here ds18b20.c(181): error: #254: type name is not allowed ds18b20.h(17): error: #10: "#" not expected here ds18b20.c(181): error: #65: expected a ";" ds18b20.h(19): error: #10: "#" not expected here ds18b20.c(181): error: #20: identifier "i" is undefined ds18b20.h(22): warning: #1-D: last line of file ends without a newline "ds18b20.c" - 9 Error(s), 0 Warning(s). ds18b20.c(52): warning: #12-D: parsing restarts here after previous syntax error delay_us(400); ds18b20.c(53): error: #169: expected a declaration return 0; // ??? ds18b20.c(54): error: #169: expected a declaration } ds18b20.c(131): warning: #12-D: parsing restarts here after previous syntax error delay_us(55); // ?????? ds18b20.c(132): error: #169: expected a declaration } ds18b20.c(135): error: #169: expected a declaration } ds18b20.c(184): warning: #12-D: parsing restarts here after previous syntax error return temperature; ds18b20.c(185): error: #169: expected a declaration } ds18b20.c: 7 warnings, 18 errors "ds18b20.c" - 18 Error(s), 7 Warning(s).
06-22
var editor; var action = $.queryString("action"); var Pid = $.queryString("id"); $(function () { //设置返回列表的href, location_prior的href在后台打开当前记录信息时赋值。 // $("#location_back").attr("href", $("#location_prior").attr("href")); //用户获取出来,获取本部门用户。 //获取本部门的权限, $.ajax({ type: "POST", url: "../services/Dtry.ashx", headers: { "Authorization": "0772A4AA051DDEBB393DC164B19A32E57C4FEEAB27A77820" }, data: { action: "names", id: Pid }, success: function (msg) { $.each(msg.ds, function (index, item) { if (item.pid == -1) { $('#qx').append('<div><ul><li> <input id="a' + item.id + '" type="checkbox" name="select_checkbox" onclick="chk_changed();" value="' + item.id + '" /><a class="sz" href="javascript:onClick=show(' + item.id + ')">' + item.name + '</a></li></ul><ul id="' + item.id + '"> </ul></div>'); } else { $('#' + item.pid).append('<li class="sc"> <input id="a' + item.id + '" type="checkbox" name="select_checkbox" onclick="chk_changed(this);" value="' + item.id + '"/><a class="zt" href="javascript:onClick=show(' + item.id + ')">' + item.name + '<br/><ul class="cc" style="display:none" id="' + item.id + '"> </ul></li>') } }) $('#typeid').val(Pid); } }); $('#user_nickname').on('change', getQ); //初始化表单验证 $("#form1").initValidform(); $(".rule-single-checkbox").ruleSingleCheckbox(); $(".rule-single-select").ruleSingleSelect(); // var result = ""; }); function chk_changed(that) { var th = $(that); if (th.is(':checked')) { console.log('已选中'); } else { console.log('未选中'); } th.next('a').find('input').attr("checked", "true"); th.parent().parent().siblings().find('input').attr("checked", "true"); th.parent().parent().parent().siblings().attr("checked", "true"); var result = ""; $("input[name='select_checkbox']:checked").each(function () { result += $(this).val() + ','; }); if (result != "") { result = result.substring(0, result.lastIndexOf(',')); } $("#typename").val(result); } function show(d1) { if (document.getElementById(d1).style.display == 'none') { document.getElementById(d1).style.display = 'block'; //触动的层如果处于隐藏状态,即显示 } else { document.getElementById(d1).style.display = 'none'; //触动的层如果处于显示状态,即隐藏 } } var getQ = function () { var userid = $('#user_nickname').val(); if (userid == null || userid == undefined) { return false; } else { $.ajax({ type: "POST", url: "../services/Dtry.ashx", headers: { "Authorization": "0772A4AA051DDEBB393DC164B19A32E57C4FEEAB27A77820" }, data: { action: "getQ", id: userid }, success: function (msg) { $.each(msg.ds, function (index, item) { $('#a' + item.typeid).attr("checked", true); }) var result = ""; $("input[name='select_checkbox']:checked").each(function () { result += $(this).val() + ','; }); if (result != "") { result = result.substring(0, result.lastIndexOf(',')); } $("#typename").val(result); } }); } } 详细翻译代码内容
03-11
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值