日期:2014-05-16  浏览次数:20346 次

js 删除类的属性
   allUpdateSave: function(panelView)
        { //批量修改保存
            if (!panelView.isFormValid())
            {
                return;
            }
            var formData = panelView.getFormValues();
            var formDataSoureId = panelView.__config.DATA_SOURCE;
            var isChange = false;
            for(var i in formData) {
                 if (formData[i]==null||formData[i]=="") {
		          	delete formData[i];  //删除为空的属性
                }else{
                    isChange = true;
                }
            }
          if (isChange == true)
            {
                var ids = panelView.parameters.ids;
                if (ids == "")
                {
                    Ext.Msg.alert("系统提示", "批量修改的参数不对,缺少ids!");
                }
                var ids_ = ids.split(",");
                for (var k = 0; k < ids_.length; k++)
                {
                    formData.id = ids_[k];
                    Platform.ds.save(formDataSoureId,
                    formData, function(msg)
                    {});


                }
                setTimeout(ArchivePlat.refresh(panelView), 800);
            }
            else
            {
                Ext.Msg.alert("系统提示", "请输入需要修改的内容!");
            }




        },

?