12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- /**
- * 字典数据维护
- *
- */
- $.namespace("codeChild.main");
- codeChild.main.init=function(){
- //把form传入,构造翻页控件
- pageinfo($("#codeChildform"));
- }
- codeChild.main.search=function(){
- $("#codeChildform").submit();
- }
- codeChild.main.back=function(){
- location.href=$.app+"/code/main";
- }
- codeChild.main.del=function(data){
- $.confirm({
- title: '确认框',
- content: '确认删除吗',
- confirm: function(){
- $.post($.app + "/codeChild/delete", {
- id : data
- }, function(data) {
- if (data.success) {
- $.alert({
- title: '提示',
- content: '删除成功',
- confirm: function(){
- $("#codeChildform").submit();
- }
- });
- } else {
- $.alert({
- title: '提示',
- content: data.message,
- confirm: function(){
-
- }
- });
- }
- }, "json");
- },
- cancel: function(){
-
- }
- });
- }
- codeChild.main.edit=function(data){
- $.post($.app + "/codeChild/edit", {
- id : data
- }, function(data) {
- if(data){
- for(var a in data){
- if($("#edit"+a)){
- $("#edit"+a).val(data[a]);
- }
- }
- }
- }, "json");
- }
- codeChild.main.save=function(){
- $.ajax({
- url:$.app+"/codeChild/save",
- data:$("#addform").serialize(),
- type:"post",
- dataType:"json",
- success:function(data){//ajax返回的数据
- if (data.success) {
- $.alert({
- title: '提示',
- content: '保存成功',
- confirm: function(){
- $("#codeChildform").submit();
- }
- });
- }else {
- $.alert({
- title: '提示',
- content: data.message,
- confirm: function(){
-
- }
- });
- }
- }
- });
- }
|