4-19总结

1.刚创建.net core 依赖项 有黄色叹号 运行报错
找不到资产文件“F:\Demo\websample\WebReport\WebReport\obj\project.assets.json”。
运行 NuGet 程序包还原以生成此文件。    WebReport    C:\Program 
Files\dotnet\sdk\2.1.4\Sdks\Microsoft.NET.Sdk\build\Microsoft.PackageDependencyResolution.targets

创建的时候没有联网,所以nuget的包没有下载。

2.刚创建的.net core 没有黑框开启日志 因为使用了默认的iisexpress,如果使用Webreport 就有黑框日志。

3.bootstrap table的简单使用

https://bootstrap-table.com/docs/api/methods/

api的结构

1.table options 表选项
    height 高度
    Attribute: data-height 属性 (属性是在选项的基础上加上前缀data-)
    Type: Number 类型 数字
    Detail: 详细解释
    The height of table, enable fixed header of table. 表格的高度
    Default: undefined 默认值 undefined

2.column options 列选项
radio 是否单选框
Attribute: data-radio 
Type: Boolean 布尔型
Detail: 详细信息 如果设置为true,单选列有固定的宽度
Set true to show a radio. The radio column has fixed width.
Default: false 默认值  false
3.events 事件
调用事件例子
$('#table').bootstrapTable({
  onEventName: function (arg1, arg2, ...) {
    // ...
  }
})

onClickRow 点击行
jQuery Event: click-row.bs.table jq事件

Parameter: row, $element, field 参数 行 元素 字段

Detail:详细信息 当用户点击行的时候,参数包含 行,tr元素,列字段

Fires when user click a row, the parameters contain:

row: the record corresponding to the clicked row.
$element: the tr element.
field: the field name corresponding to the clicked cell.


4.methods 方法
调用方法的例子 $('#table').bootstrapTable('method', parameter).
getSelections 获取选择行
Parameter: undefined 参数 undefined

Detail: 详细信息 返回选择的行,如果没有选择,则返回为空数组。

Return selected rows, when no record selected, an empty array will return.


5.localizations 本地化
1、导入本地化的文件
<script src="bootstrap-table-zh-CN.js"></script>


表选项:

url     地址  服务器返回的数据格式和sidePagination有关系
        [{"id": 0,"name": "Item 0","price": "$0","amount": 3},...], 不需要服务器分页
        {"total": 200,"rows": [{"id": 0,"name": "Item 0","price": "$0"},...]} 需要服务器分页
method 默认是'get'
data-side-pagination 默认值是'client'   'server'
cache 默认true 这是设置是否使用ajax缓存 设置为false 一般不使用


分页:
pagination 默认false 设置为true 开启
pageNumber: 1, 默认1
pageSize: 5, 默认10
pageList: [10, 25, 50, 100], 默认 [10, 25, 50, 100]

查询
search 默认false 客户端查询

刷新
showRefresh 默认false 

查询条件
queryParams 类型是函数 这个函数返回一个对象包含了要提交后台的查询参数。
$("#table").bootstrapTable('refresh', { url: '/Home/GetTData', slient: true, query: {Res:2} });
注意参数的query

最好把要查询的参数放到cookie里面。这样参数比较好更新。
$("#table").bootstrapTable('refresh');

数据相关

clickToSelect 默认false  是否 点击行就选中
singleSelect 默认false 是否 单选
maintainSelected 默认false  是否 维护选择


getSelections 获取选择行
onCheck:function(){ //} check的时候触发

jquery ui dialog

API
Options 选项
title  标题
Type: String 数据类型 字符串
Default: null 默认值
对话框的标题
Specifies the title of the dialog. If the value is null, the title attribute on the dialog source element will be used.

Methods 方法
close() 关闭
Closes the dialog. 关闭对话框
This method does not accept any arguments. 这个方法没有参数
Events 事件
open( event, ui ) 打开
Triggered when the dialog is opened. 当对话框打开的似乎触发
event
Type: Event
ui
Type: Objec


buttons
height 
width 
modal 默认false
resizable 默认true

destroy() 销毁
create( event, ui )


table 和 dialog 和表单

toolbar

x-edit不好用,直接使用table和dialog交互的方法既可以。

猜你喜欢

转载自blog.csdn.net/MannMann/article/details/89399314