我使用iTextSharp.dll与以下代码:
var Title = "This is title";
var Description = "This is description";
Innertable.AddCell(new PdfPCell(new Phrase(string.Format("{0} {1}", Title, Description.Trim()), listTextFont)) { BackgroundColor = new BaseColor(233, 244, 249), BorderWidth = 0, PaddingTop = 4, PaddingLeft = -240, PaddingBottom = 5, HorizontalAlignment = Element.ALIGN_LEFT });
Run Code Online (Sandbox Code Playgroud)
我们可以为标题和描述设置不同的字体颜色,但只使用单个单元格(即不创建新表格)?
任何有关此事的帮助将不胜感激.
这是我的代码,用于从以集合名称初始化的集合组名称获取数据。我想使用foreach循环来迭代存储在doc中的数据。
var db = mongojs('login');
var cursor = db.collection(groupname).find();
console.log(cursor);
cursor.each(function(err, doc) {
console.log(doc._id);
mongo.collection(doc._id + "group", function(err, collection) {
collection.remove({"groupname": groupname});
});
});
Run Code Online (Sandbox Code Playgroud)
我已经尝试做过db.collectionname.find().forEach(....),但是出现一个错误,说这样的功能不存在。请帮忙。
我创建了一个Angular指令,该指令应该在按下转义键时关闭一个模态.模态服务在控制器中使用时工作正常,但由于某种原因,它在该指令中不起作用.hello按下转义时将打印以下代码,但不会隐藏模态.有任何想法吗?
指示
app.directive("dpEscape", function(modal) {
return function(scope, element, attributes) {
element.on("keyup", function(event) {
if (event.keyCode == 27) {
console.log("hello");
modal.hide();
}
});
};
});
Run Code Online (Sandbox Code Playgroud)
我实际上并不认为以下任何代码与问题相关,但我可能是错的.因为我知道人们无论如何都要求它,这里是:
HTML
...
<html ng-app="trread" ng-controller="Main" dp-escape>
...
Run Code Online (Sandbox Code Playgroud)
服务
app.factory("modal", function() {
var urlPath = "/templates/modals/";
var visible = false;
var templateUrl = "";
var content = {};
var controller = {};
var size = {width: 500, height: 500};
var show = function() {
visible = true;
}
var hide = function() {
visible …Run Code Online (Sandbox Code Playgroud) javascript angularjs angular-ui angularjs-directive angular-ui-bootstrap
如何执行getNearest查询其他命令的结果,例如过滤命令?
var point = r.point(-122.422876,37.777128);
r.db('test').table('users').
filter({tags : 'tag'}).
getNearest(point, {index: 'geodata', maxResults: 30, unit :'km'})
Run Code Online (Sandbox Code Playgroud)
我有一个'用户'表:
[
{id: 1, tags : ['music', 'cups'], geodata: r.point()}
{id: 2, tags: ['music', 'play'], geodata: r.point()}
]
Run Code Online (Sandbox Code Playgroud)
首先,我想通过'tags'字段过滤,然后返回最近的字段.
我指定的查询不正确,返回以下错误:" RqlRuntimeError:预期类型TABLE但找到SELECTION "
angular-ui ×1
angularjs ×1
asp.net ×1
c# ×1
foreach ×1
itextsharp ×1
javascript ×1
mongodb ×1
mongojs ×1
node.js ×1
pdf ×1
rethinkdb ×1