我正在使用jQuery select2插件并试图让AJAX与我的ext数据一起工作,这显然不起作用,我只是想知道是否有人可以指出我做错了什么或丢失了什么?
注意这仅适用于选择v3.5.2
我的js:
$('#cliselect').select2({
ajax: {
dataType: "json",
url: "clientprojectpopulate.php",
results: function (data) {
return {results: data};
}
}
});
Run Code Online (Sandbox Code Playgroud)
HTML:
<select id="cliselect" name="cliselect" style="width: 100%;" /></select>
Run Code Online (Sandbox Code Playgroud)
我的JSON返回(我认为是有效的):
[{"id":"62","text":"Alberta Innovates Health Solutions"},{"id":"4","text":"Alterna Savins & Credit Union"},{"id":"63","text":"BC Patient Safety & Quality Council"}]
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用${PRODUCT_NAME}
Info.plist 中的变量,但在我本地化的 InfoPlist.strings 文件中使用它,该文件将在弹出通知时显示应用程序名称。这甚至可能吗?
当我尝试以这种方式执行此操作时,我会收到一个带有正确语言的弹出窗口,但它显示$(PROGRAM_NAME)
而不是"My App Name"
......
Info.plist:
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>${PRODUCT_NAME} would like to use your current location while using the app and in the background</string>
InfoPlist.strings (EN):
"NSLocationAlwaysAndWhenInUseUsageDescription" = "${PRODUCT_NAME} would like to use your current location while using the app and in the background";
InfoPlist.strings (FR):
"NSLocationAlwaysAndWhenInUseUsageDescription" = "${PRODUCT_NAME} souhaiteraient utiliser votre emplacement actuel en utilisant l'application et en arrière-plan";
Run Code Online (Sandbox Code Playgroud)
在phpexcel中如何删除2个单元格之间的中间边界线?
像这张照片:
它目前显示为:
这是我目前的代码:
$styleArray = array(
'borders' => array(
'allborders' => array(
'style' => PHPExcel_Style_Border::BORDER_DOUBLE
)
)
);
$objPHPExcel->getActiveSheet()->getStyle("G".$rownum.":H".$rownum)->applyFromArray($styleArray);
unset($styleArray);
Run Code Online (Sandbox Code Playgroud) 当我使用celltemplate进行ahref链接时,一旦链接被点击,该行突出显示,因为我已启用RowSelection ...但我不希望在单击链接时突出显示该行...仅在链接点击任何地方时才会点击该行.
另外在我的下面的示例图片中,如何删除小箭头,以便不能为该列显示Menuitems?
码:
$scope.gridOptions = {
showFooter: true,
enableFiltering: true,
enableRowSelection: true,
enableRowHeaderSelection: false,
enableSelectAll: true,
multiSelect: true,
enableColumnResizing: true,
columnDefs: [
{ field:'date', displayName: 'Date', width: 200, aggregationType: uiGridConstants.aggregationTypes.count },
{ field:'notes', displayName: 'Notes', width: 65, enableFiltering: false, enableSorting: false, enableHiding: false, cellTemplate:'<a href="#" ng-click="getExternalScopes().showMe(row.entity[col.field])">View</a>' }
],
data: data
}
Run Code Online (Sandbox Code Playgroud)
图:
如何从mysql中的多个相同日期获取最新的日期时间?
SELECT start_time FROM times WHERE start_time BETWEEN '2013-01-27' AND '2013-02-02' ORDER BY start_time
Run Code Online (Sandbox Code Playgroud)
这个输出:
2013-01-27 00:00:00
2013-01-28 09:00:00
2013-01-29 00:00:00
2013-01-30 09:00:00
2013-01-31 00:00:00
2013-02-01 09:00:00
2013-02-01 21:00:00
2013-02-02 00:00:00
Run Code Online (Sandbox Code Playgroud)
我希望所有这些输出除了我想要2013-02-01的最新日期时间所以它将输出如下:
2013-01-27 00:00:00
2013-01-28 09:00:00
2013-01-29 00:00:00
2013-01-30 09:00:00
2013-01-31 00:00:00
2013-02-01 21:00:00 <<<<<<<<
2013-02-02 00:00:00
Run Code Online (Sandbox Code Playgroud) 如何在包含来自最后一页的OTHER变量的URL中传递目标变量?
基本上,当我打开时index.php?year=2014&month=3
,当我点击edit.php链接时我希望它记住(index.php?year=2014&month=3
)所以它在编辑后将它返回到那里...我把它放在$destination
但它与我的URL变量冲突...
SERVER['REQUEST_URI']
收益: index.php?year=2014&month=3
我的PHP代码:
$destination = $_SERVER['REQUEST_URI'];
$edit_url = "edit.php?id=$id&proj=$proj&t=$t&year=$year&month=$month&day=$day&destination=$destination";
Run Code Online (Sandbox Code Playgroud)
当我点击编辑链接时:
http://www.site.com/edit.php?id=5&proj=3&t=1&year=2014&month=4&day=13&destination=/index.php?year=2014&month=3
一旦它需要我,edit.php
我注意到它没有捕获&month=3
源中显示的隐藏输入:
<input type="hidden" name="destination" value="/index.php?year=2014">
Run Code Online (Sandbox Code Playgroud)
它应该显示:
<input type="hidden" name="destination" value="/index.php?year=2014&month=3">
Run Code Online (Sandbox Code Playgroud)
我知道这是因为&
导致这种情况的迹象......是否有可能使url.php?blah=1&destination=/page.php?var=1&var=2
??? 如果是这样,有人可以告诉我怎么样?
我注意到这个问题问了几次,但没有正确的正确答案或正确的反馈来引导正确的道路。
我正在使用fullcalendar javascript插件,并尝试添加每天多个事件的总时间,然后我将在每天的页眉或页脚中显示总和。
我尝试了许多不同的方法来完成此操作,但最接近结果的是此代码:
eventAfterRender: function(event, element, view) {
if (event.totalhrs > 0) {
var sd = event.startdate;
if (dateTotal.hasOwnProperty(sd)) {
dateTotal[event.startdate] = (dateTotal[event.startdate] + +event.totalhrs);
} else {
dateTotal[event.startdate] = +(event.totalhrs);
}
$(".fc-day-top[data-date='"+event.startdate+"']").find('.fc-dailytotal').text(dateTotal[event.startdate]);
}
}
Run Code Online (Sandbox Code Playgroud)
当第一次渲染日历时,此方法有效,但是如果发生事件更改,它将继续错误地添加总计,显示非常高的值。我理解为什么将其总数相加不正确,(dateTotal[event.startdate] + +event.totalhrs)
但是我希望有人可以帮助我朝正确的方向完成正确的结果。
感谢任何反馈/帮助。
我试图将我的变量推送到这个对象但不确定如何以正确的方式:
如果手动输入jsonArray如下所示:
jsonArray = {
"Person 1": ["Address Rd. City", "777 Street Ave. City"],
"Person 2": ["Address2 Rd. City2", "777 Street Ave. City"]
}
Run Code Online (Sandbox Code Playgroud)
我有一个循环,我想将变量推入jsonArray,我正在这样尝试:
var jsonArray = {};
for (var i = 0....my loop, etc)...
jsonArray.push({fullname: [address, destination]});
Run Code Online (Sandbox Code Playgroud)
这不起作用,当我JSON.stringify(jsonArray)时,jsonArray总是显示为{}
我试图用数组中的一些数据来制作这个javascript变量,但我无法弄清楚正确的语法来使这个工作..
certifications will be "Win7,Win8,PDI"
var myArray = certifications.split(",");
var data = "[{" +
for (var i in myArray)
" "id":i,"text":myArray[i]}, " +
"}]";
Run Code Online (Sandbox Code Playgroud)
我希望我的数据变量看起来像:
var data = "[{"id":0,"text":Win7},{"id":1,"text":Win8},{"id":2,"text":PDI}]";
Run Code Online (Sandbox Code Playgroud) 使用select2插件(http://select2.github.io/select2/)
这将搜索$ choicestring变量的所有选项值,然后选择找到的值.如果它搜索超过200个选项值大约需要5-6秒......我试图减少这个.
有没有办法加快我的搜索元素包含字符串代码?
使用for循环而不是$ .each会更好吗?
jQuery的:
$('#selectbutton').click(function() {
var selectstring = $('#selectstring').val();
if (!selectstring.trim())
return false;
stringVal.push($('#projadd\\[\\]').val());
$('#projadd\\[\\]').find('option').each(function(){
if($(this).is(':contains(' + selectstring + ')')){
stringVal.push($(this).val());
}
$('#projadd\\[\\]').val(stringVal).trigger("change");
});
$('#selectstring').val('');
});
Run Code Online (Sandbox Code Playgroud) javascript ×5
jquery ×4
php ×2
ajax ×1
fullcalendar ×1
group-by ×1
info.plist ×1
localization ×1
mysql ×1
ng-grid ×1
phpexcel ×1
sql ×1
xcode ×1