1.stark的組件之action(自定製函數多選功能效果)
1.1 admin效果
![](http://static.javashuo.com/static/loading.gif)
1.2 多選效果前端和後端進行的操做
![](http://static.javashuo.com/static/loading.gif)
1.2.1 前端發過來的參數是?號後各個參數用&來拼接
1.2.2 後端django會自動把形同的key的內容進行拼接成列表
![](http://static.javashuo.com/static/loading.gif)
1.3 action 內容賦值,給check綁定id
1.3.1 前端內容賦值
![](http://static.javashuo.com/static/loading.gif)
1.3.2 django-static內容書寫前端代碼
![](http://static.javashuo.com/static/loading.gif)
1.4 設置多選函數框action框
1.4.1 前端代碼書寫
![](http://static.javashuo.com/static/loading.gif)
1.4.2 效果圖
![](http://static.javashuo.com/static/loading.gif)
1.4.3 stites設置action 內容
1.4.3.1 自定製刪除函數(設置默認函數)
![](http://static.javashuo.com/static/loading.gif)
1.4.3.2 設置默認顯示函數
![](http://static.javashuo.com/static/loading.gif)
1.4.3.3 設置顯示到前端的內容
以字典的形式顯示到前端前端
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
1.5 action的內容與前端內容交互
接收到前端的post請求後,獲取當前函數名,若是函數名不爲空, 獲取函數名經過類反射獲取當前函數,django
接收前端的checked 內容id ,存爲元祖 ,queryset 過濾獲取對應內容,以後再把內容放到函數中進行進一步操做後端
1.5.1 代碼以下
![](http://static.javashuo.com/static/loading.gif)
1.5.2 執行的函數
![](http://static.javashuo.com/static/loading.gif)
1.5.3效果以下
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
1.5.4全選效果
![](http://static.javashuo.com/static/loading.gif)
jq部分函數
![](http://static.javashuo.com/static/loading.gif)
stark註冊使用post
![](http://static.javashuo.com/static/loading.gif)
2. 多級過濾
2.1 多級過濾的順序
![](http://static.javashuo.com/static/loading.gif)
2.2 實現步驟
2.2.1 設置接口
![](http://static.javashuo.com/static/loading.gif)
2.2.2 註冊內容
![](http://static.javashuo.com/static/loading.gif)
2.2.3 對一對多,多對多以及choice查詢設置多重過濾
獲取數據3d
![](http://static.javashuo.com/static/loading.gif)
建立標籤blog
![](http://static.javashuo.com/static/loading.gif)
過濾部分接口
![](http://static.javashuo.com/static/loading.gif)
最終過濾結果it
![](http://static.javashuo.com/static/loading.gif)
前端樣式io
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
效果圖
![](http://static.javashuo.com/static/loading.gif)
a